What would you like to be added:
Implement proper validation for KubernetesApplicationSpec in the pipedv1 Kubernetes plugin (pkg/app/pipedv1/plugin/kubernetes/config), replacing the current // TODO: Validate KubernetesApplicationSpec fields. stub.
Validation should cover at least:
-
Mutually exclusive input options
- Reject configs that set both
input.helmChart and input.kustomizeOptions.
-
Traffic routing method
- When
trafficRouting is set, allow only supported methods ("", podselector, istio) and fail clearly on unknown values.
-
Variant labels
- Require non-empty
variantLabel.key, primaryValue, canaryValue, and baselineValue.
- Require
primaryValue, canaryValue, and baselineValue to be unique.
Add unit tests for valid configs, each failure case, and that JSON unmarshaling applies defaults so a minimal {} spec remains valid after defaults are set.
Why is this needed:
Invalid Kubernetes application configs are currently accepted and only fail later during plan/sync (or produce confusing progressive-delivery behavior). Early validation:
- Surfaces configuration mistakes immediately with actionable error messages.
- Prevents impossible combinations (e.g. Helm chart + Kustomize options).
- Protects progressive delivery by ensuring variant labels and traffic-routing method are usable before a deployment starts.
- Aligns the single-cluster Kubernetes plugin with existing validation patterns used by other plugins (e.g. multicluster Kubernetes, analysis, terraform).
What would you like to be added:
Implement proper validation for
KubernetesApplicationSpecin the pipedv1 Kubernetes plugin (pkg/app/pipedv1/plugin/kubernetes/config), replacing the current// TODO: Validate KubernetesApplicationSpec fields.stub.Validation should cover at least:
Mutually exclusive input options
input.helmChartandinput.kustomizeOptions.Traffic routing method
trafficRoutingis set, allow only supported methods ("",podselector,istio) and fail clearly on unknown values.Variant labels
variantLabel.key,primaryValue,canaryValue, andbaselineValue.primaryValue,canaryValue, andbaselineValueto be unique.Add unit tests for valid configs, each failure case, and that JSON unmarshaling applies defaults so a minimal
{}spec remains valid after defaults are set.Why is this needed:
Invalid Kubernetes application configs are currently accepted and only fail later during plan/sync (or produce confusing progressive-delivery behavior). Early validation: