Skip to content

[Multi_K8s-Plugin] Add config validation for KubernetesApplicationSpec#6747

Merged
Warashi merged 7 commits into
pipe-cd:masterfrom
mohammedfirdouss:feat/multicluster-config-validation
May 24, 2026
Merged

[Multi_K8s-Plugin] Add config validation for KubernetesApplicationSpec#6747
Warashi merged 7 commits into
pipe-cd:masterfrom
mohammedfirdouss:feat/multicluster-config-validation

Conversation

@mohammedfirdouss

@mohammedfirdouss mohammedfirdouss commented May 7, 2026

Copy link
Copy Markdown
Contributor

What this PR does / Why we need it:

Implements KubernetesApplicationSpec.Validate() in the multicluster Kubernetes plugin. The method was previously a stub that always returned nil, meaning invalid configs passed silently at load time and only failed mid-deployment with cryptic errors.

Two validations are added:

  1. helmChart and kustomizeOptions are mutually exclusive — only one templating method can be used. Specifying both previously resulted in undefined/silent behaviour.

  2. Each multiTargets[].target.name must not be empty — an empty target name causes the deploy target lookup to fail at runtime. This catches it before any stage runs.

Which issue(s) this PR fixes:

Part of #6446

How was this tested:

Unit tests added to config/application_test.go covering:

  • Empty spec (valid)
  • Valid multiTargets
  • multiTargets with an empty target name (error)
  • helmChart + kustomizeOptions together (error)
  • Each individually (valid)

Note for single-cluster kubernetes plugin: pkg/app/pipedv1/plugin/kubernetes/config/application.go has the same Validate() stub (introduced in #5356). The same two validations apply there, plus the single-cluster plugin does not have multiTargets so only the helm/kustomize mutual exclusion check is relevant.

cc @Warashi you introduced the original stub in the single-cluster plugin, flagging in case you want to track this.

@mohammedfirdouss mohammedfirdouss requested a review from a team as a code owner May 7, 2026 21:53
@mohammedfirdouss mohammedfirdouss force-pushed the feat/multicluster-config-validation branch from 0dee6a8 to 9f895a1 Compare May 7, 2026 21:54
Signed-off-by: Mohammed Firdous <124298708+mohammedfirdouss@users.noreply.github.com>

@Warashi Warashi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Warashi Warashi merged commit 74acc29 into pipe-cd:master May 24, 2026
45 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for contributing to PipeCD! The changes in this pull request will be part of the upcoming release!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants