livestate.loadManifests ignores per-target KustomizeVersion and KustomizeOptions
What happened
The multicluster livestate plugin ignores per-target KustomizeVersion and KustomizeOptions overrides defined in multiTargets.
While the deployment plugin applies these per-target overrides before constructing provider.LoaderInput, the livestate implementation always uses the top-level values from spec.Input.
As a result, deployment and livestate may render manifests using different Kustomize versions or options for the same target, which can lead to inconsistent manifest rendering and potentially incorrect drift/sync calculations.
This appears to be another divergence between the deployment and livestate implementations. PR #6783 already addressed kustomizeDir and tracking labels, but KustomizeVersion and KustomizeOptions are still not handled in the same way.
What you expected to happen
livestate.loadManifests() should apply the same precedence as the deployment implementation:
- Use the top-level
KustomizeVersionandKustomizeOptionsby default. - Override them with
multiTarget.KustomizeVersionwhen specified. - Override them with
multiTarget.KustomizeOptionswhen specified.
This would ensure that deployment and livestate render manifests consistently for the same target.
How to reproduce it
- Create a Kubernetes Multicluster application.
- Configure a top-level
kustomizeVersion(orkustomizeOptions). - Configure one
multiTargetwith differentkustomizeVersionand/orkustomizeOptions. - Run a deployment and observe that the deployment path uses the per-target overrides.
- Run livestate for the same application.
- Observe that the livestate path still uses the top-level values instead of the per-target overrides.
From the current implementation:
deployment/loadManifests()appliesmultiTarget.KustomizeVersionandmultiTarget.KustomizeOptions.livestate/loadManifests()always passesspec.Input.KustomizeVersionandspec.Input.KustomizeOptionsdirectly toprovider.LoaderInput.
Environment
-
piped version: master (current HEAD)
-
control-plane version: N/A
-
Others:
- Related PR: #6783 ("fix(kubernetes_multicluster): stamp tracking labels and honour kustomizeDir in livestate loadManifests"), which fixed
kustomizeDirparity but does not apply the same per-target precedence forKustomizeVersionandKustomizeOptions.
- Related PR: #6783 ("fix(kubernetes_multicluster): stamp tracking labels and honour kustomizeDir in livestate loadManifests"), which fixed
/assign
hi, #7107 was closed as stale. is it ok if i work on this? i have a fix and a test ready.
@srinivasr yeah sure