Add config validation for KubernetesApplicationSpec in pipedv1
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 1.4k
- Forks
- 364
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 84
Description
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.helmChartandinput.kustomizeOptions.
- Reject configs that set both
-
Traffic routing method
- When
trafficRoutingis set, allow only supported methods ("",podselector,istio) and fail clearly on unknown values.
- When
-
Variant labels
- Require non-empty
variantLabel.key,primaryValue,canaryValue, andbaselineValue. - Require
primaryValue,canaryValue, andbaselineValueto be unique.
- Require non-empty
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).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in pkg/app/pipedv1/plugin/kubernetes/config at the TODO for KubernetesApplicationSpec validation, and compare validation patterns in the multicluster Kubernetes, analysis, and terraform plugins. Add tests for valid defaults, mutually exclusive Helm and Kustomize inputs, supported traffic-routing methods, and variant-label requirements; run the package tests and confirm minimal JSON defaults remain valid.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes
- Domain
- devops, infrastructure
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 74/100