Skip to content

Add config validation for KubernetesApplicationSpec in pipedv1 #7142

Description

@ayushsarode

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:

  1. Mutually exclusive input options

    • Reject configs that set both input.helmChart and input.kustomizeOptions.
  2. Traffic routing method

    • When trafficRouting is set, allow only supported methods ("", podselector, istio) and fail clearly on unknown values.
  3. 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).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions