Repository: zarf-dev/zarf (Go)

Issue:
Flavor validation on `package create`
### 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.



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



Fix (patch):
diff --git a/src/internal/packager2/layout/create.go b/src/internal/packager2/layout/create.go
index c074ac49ff..1b5fc99bbc 100644
--- a/src/internal/packager2/layout/create.go
+++ b/src/internal/packager2/layout/create.go
@@ -281,16 +281,18 @@ func LoadPackage(ctx context.Context, packagePath, flavor string, setVariables m
 			return v1alpha1.ZarfPackage{}, err
 		}
 	}
-	err = validate(pkg, packagePath, setVariables)
+	err = validate(pkg, packagePath, setVariables, flavor)
 	if err != nil {
 		return v1alpha1.ZarfPackage{}, err
 	}
 	return pkg, nil
 }
 
-func validate(pkg v1alpha1.ZarfPackage, packagePath string, setVariables map[string]string) error {
-	err := lint.ValidatePackage(pkg)
-	if err != nil {
+func validate(pkg v1alpha1.ZarfPackage, packagePath string, setVariables map[string]string, flavor string) error {
+	if err := validateFlavorExists(pkg, flavor); err != nil {
+		return err
+	}
+	if err := lint.ValidatePackage(pkg); err != nil {
 		return fmt.Errorf("package validation failed: %w", err)
 	}
 	findings, err := lint.ValidatePackageSchemaAtPath(packagePath, setVariables)
@@ -307,6 +309,18 @@ func validate(pkg v1alpha1.ZarfPackage, packagePath string, setVariables map[str
 	}
 }
 
+func validateFlavorExists(pkg v1alpha1.ZarfPackage, flavor string) error {
+	if flavor == "" {
+		return nil
+	}
+	for _, comp := range pkg.Components {
+		if comp.Only.Flavor == flavor {
+			return nil
+		}
+	}
+	return fmt.Errorf("could not find flavor %s in package definition", flavor)
+}
+
 func assemblePackageComponent(ctx context.Context, component v1alpha1.ZarfComponent, packagePath, buildPath string) error {
 	tmpBuildPath, err := utils.MakeTempDir(config.CommonOptions.TempDirectory)
 	if err != nil {