Skip to content

[Multi_K8s-Plugin] Add per-target kustomizeVersion and kustomizeOptions#6749

Open
mohammedfirdouss wants to merge 2 commits intopipe-cd:masterfrom
mohammedfirdouss:feat/multicluster-per-target-kustomize-overrides
Open

[Multi_K8s-Plugin] Add per-target kustomizeVersion and kustomizeOptions#6749
mohammedfirdouss wants to merge 2 commits intopipe-cd:masterfrom
mohammedfirdouss:feat/multicluster-per-target-kustomize-overrides

Conversation

@mohammedfirdouss
Copy link
Copy Markdown
Contributor

@mohammedfirdouss mohammedfirdouss commented May 7, 2026

What this PR does / Why we need it:

Adds kustomizeVersion and kustomizeOptions as per-target overrides inside each multiTargets entry in KubernetesMultiTarget, bringing the config schema closer to the RFC-0014 spec.

Previously, kustomizeVersion and kustomizeOptions were only available at the top-level spec.input, meaning all targets had to share the same kustomize version and options. This is a problem when deploying to clusters with different kustomize version requirements or different per-cluster flags (e.g. load-restrictor).

With this change, users can override these per target:

input:
  multiTargets:
    - target:
        name: cluster-hoge
      kustomizeVersion: "5.4.3"
      kustomizeOptions:
        load-restrictor: "LoadRestrictionsNone"
    - target:
        name: cluster-fuga
      kustomizeVersion: "5.3.0"

The override logic follows the same pattern already used for manifests in loadManifests: the per-target value is used when non-empty, otherwise the top-level spec.input value is used.

Which issue(s) this PR fixes:

Part of #6446

How was this tested:

Unit tests added to deployment/load_manifests_test.go using a capturing mock loader that records the LoaderInput passed to it, covering:

  • Top-level values used when multiTarget has none
  • Per-target version overrides top-level version
  • Per-target options override top-level options
  • Both version and options overridden together
  • nil multiTarget falls back to top-level values

Signed-off-by: Mohammed Firdous <124298708+mohammedfirdouss@users.noreply.github.com>
Signed-off-by: Mohammed Firdous <124298708+mohammedfirdouss@users.noreply.github.com>
@mohammedfirdouss mohammedfirdouss force-pushed the feat/multicluster-per-target-kustomize-overrides branch from 29b8d04 to 740f3e3 Compare May 9, 2026 22:10
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.

1 participant