Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flavor validation on package create #2587

Open
decleaver opened this issue Jun 6, 2024 · 1 comment
Open

Flavor validation on package create #2587

decleaver opened this issue Jun 6, 2024 · 1 comment
Labels
enhancement ✨ New feature or request

Comments

@decleaver
Copy link
Contributor

Is your feature request related to a problem? Please describe.

If you attempt to create a package with a flavor that doesn't exist, as long as there is a component you don't get an error or warning about passing in a bad flavor.

Example: (I know this one is silly) but if you do zarf package create <dir> --flavor patchVersion9 it doesn't let you know you specified a bad flavor since you still have the podinfo component, but neither of the podinfo-flavor components get added to the created package.

zarf.yaml

kind: ZarfPackageConfig
metadata:
  name: podinfo
  version: 0.0.1

components:
  - name: podinfo
    required: true
    charts:
      - name: podinfo
        version: 6.4.0
        namespace: podinfo
        url: https://github.com/stefanprodan/podinfo.git
        gitPath: charts/podinfo
    images:
      - ghcr.io/stefanprodan/podinfo:6.4.0
    actions:
      onDeploy:
        after:
          - wait:
              cluster:
                kind: deployment
                name: podinfo
                namespace: podinfo
                condition: available

  - name: podinfo-flavor
    required: true
    only:
      flavor: patchVersion2
    charts:
      - name: podinfo
        version: 6.6.2
        namespace: podinfo-flavor
        url: https://github.com/stefanprodan/podinfo.git
        gitPath: charts/podinfo
    images:
      - ghcr.io/stefanprodan/podinfo:6.6.2
    actions:
      onDeploy:
        after:
          - wait:
              cluster:
                kind: deployment
                name: podinfo
                namespace: podinfo-flavor
                condition: available

  - name: podinfo-flavor
    required: true
    only:
      flavor: patchVersion3
    charts:
      - name: podinfo
        version: 6.6.3
        namespace: podinfo-flavor
        url: https://github.com/stefanprodan/podinfo.git
        gitPath: charts/podinfo
    images:
      - ghcr.io/stefanprodan/podinfo:6.6.3
    actions:
      onDeploy:
        after:
          - wait:
              cluster:
                kind: deployment
                name: podinfo
                namespace: podinfo-flavor
                condition: available

Describe the solution you'd like

  • Given a zarf.yaml with components using flavors
  • When running zarf package create <dir> --flavor with an invalid flavor
  • Then I get a messaging saying something like "Learn how to spell buddy!" or "invalid flavor specified"

Describe alternatives you've considered

(optional) A clear and concise description of any alternative solutions or features you've considered.

Additional context

Add any other context or screenshots about the feature request here.

@AustinAbro321
Copy link
Contributor

Great issue, We are adding on create validation in #2585 and will make sure this gets in as a validation error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ New feature or request
Projects
Status: Triage
Development

No branches or pull requests

2 participants