Repository navigation
Conversation
Cover how loadManifests in the kubernetes_multicluster livestate plugin resolves kustomizeVersion and kustomizeOptions from the top-level input and a multiTarget, by capturing the LoaderInput the loader receives. The override cases fail on this commit: loadManifests still ignores the multiTarget values. The fix lands in the next commit. Signed-off-by: srinivasr <sriniv4sreddy@gmail.com>
The deployment and plan preview paths of the kubernetes_multicluster plugin override the top-level kustomizeVersion and kustomizeOptions with the values of the matching multiTarget, but the livestate path always renders with the top-level values. Livestate can then compute drift and sync status from manifests rendered with a different kustomize version or options than the ones the deployment applied. Give livestate loadManifests the same precedence: start from the top-level input values and let a multiTarget override them when set, matching the deployment and plan preview implementations. Signed-off-by: srinivasr <sriniv4sreddy@gmail.com>
✅ Deploy Preview for pipecd-site ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
harshrajdebug
left a comment
There was a problem hiding this comment.
I tested this against master with the real loader and kustomize, in addition to the captured LoaderInput.
Setup: an app directory with shared/cm.yaml and a cluster-a/kustomization.yaml whose only resource is ../shared/cm.yaml, plus a multiTarget with kustomizeDir: cluster-a and kustomizeOptions: {load-restrictor: LoadRestrictionsNone}. The top level sets no options, so the target's option is the only thing that lets kustomize read that file. I called loadManifests with provider.NewLoader, backed by the kustomize built into kubectl (v5.7.1):
- master:
security; file '.../shared/cm.yaml' is not in or below '.../cluster-a'. GetLivestate returns this error from inside the target loop, so the application gets no livestate for any of its targets, not only this one. - this PR: loads
ConfigMap/shared.
The new TestLoadManifests_KustomizeOverrides also catches it: with master's plugin.go, the three cases where the target sets a version or options fail. The override logic is the same as in deployment/plugin.go and buildLoaderInput in planpreview, so all three paths now render a target the same way. LGTM.
cc @Warashi
What this PR does: Makes the
kubernetes_multiclusterlivestate plugin use amultiTarget'skustomizeVersionandkustomizeOptionswhen set, falling back to the top-level values, the same way the deployment plugin does.Why we need it: Livestate always rendered with the top-level values, so for a target with its own kustomize version or options it could compute sync state from manifests rendered differently from what was deployed.
Which issue(s) this PR fixes: Fixes #7106
Does this PR introduce a user-facing change?:
multiTargetswith their ownkustomizeVersion/kustomizeOptionsnow renders the same way as the deployment.