Skip to content

[dmt] Validate module.yaml consistency with package.yaml#366

Open
diyliv wants to merge 4 commits into
feature/package-yaml-requirements-validationfrom
feature/module-package-consistency
Open

[dmt] Validate module.yaml consistency with package.yaml#366
diyliv wants to merge 4 commits into
feature/package-yaml-requirements-validationfrom
feature/module-package-consistency

Conversation

@diyliv
Copy link
Copy Markdown
Contributor

@diyliv diyliv commented May 19, 2026

Summary

Add cross-validation between module.yaml and package.yaml to ensure both files stay consistent during the migration period:

  • Cross-validate name field: module.yaml name must match package.yaml name.
  • Cross-validate deckhouse requirement: module.yaml requirements.deckhouse must match package.yaml requirements.deckhouse.constraint.
  • Cross-validate kubernetes requirement: module.yaml requirements.kubernetes must match package.yaml requirements.kubernetes.constraint.
  • Cross-validate module dependencies: module.yaml flat module map is compared against package.yaml structured mandatory/conditional lists — entries without !optional must be in mandatory, entries with !optional must be in conditional. Both directions are checked.

If developers no longer want to maintain both files, they should delete module.yaml.

Example

Consistent files — no errors:

# module.yaml
name: stronghold
namespace: test
requirements:
  deckhouse: ">= 1.77"
  kubernetes: ">= 1.27"
  modules:
    mandatory-mod: ">= 1.0.0"
    optional-mod: ">= 1.0.0 !optional"

# package.yaml
name: stronghold
apiVersion: v2
requirements:
  deckhouse:
    constraint: ">= 1.77"
  kubernetes:
    constraint: ">= 1.27"
  modules:
    mandatory:
      - name: mandatory-mod
        constraint: ">= 1.0.0"
    conditional:
      - name: optional-mod
        constraint: ">= 1.0.0"

Inconsistent files — errors reported:

# module.yaml
name: stronghold
requirements:
  modules:
    some-module: ">= 1.0.0"         # mandatory here

# package.yaml
name: stronghold
requirements:
  modules:
    conditional:                     # but conditional here
      - name: some-module
        constraint: ">= 1.0.0"

Signed-off-by: diyliv <onlogn081@gmail.com>
@diyliv diyliv self-assigned this May 19, 2026
@diyliv diyliv added enhancement New feature or request go Pull requests that update go code labels May 19, 2026
diyliv added 2 commits May 19, 2026 15:21
Signed-off-by: diyliv <onlogn081@gmail.com>
Signed-off-by: diyliv <onlogn081@gmail.com>
@diyliv diyliv requested a review from ipaqsa May 19, 2026 18:31
Signed-off-by: diyliv <onlogn081@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request go Pull requests that update go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant