pipe-cd / pipe-cd/pipecd

livestate.loadManifests ignores per-target KustomizeVersion and KustomizeOptions

Open
#7,106 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/bug
Dominant language
Go
Stars
1.4k
Forks
364
Avg merge
1d 4h
Merged PRs (30d)
84

Description

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:

  1. Use the top-level KustomizeVersion and KustomizeOptions by default.
  2. Override them with multiTarget.KustomizeVersion when specified.
  3. Override them with multiTarget.KustomizeOptions when specified.

This would ensure that deployment and livestate render manifests consistently for the same target.


How to reproduce it

  1. Create a Kubernetes Multicluster application.
  2. Configure a top-level kustomizeVersion (or kustomizeOptions).
  3. Configure one multiTarget with different kustomizeVersion and/or kustomizeOptions.
  4. Run a deployment and observe that the deployment path uses the per-target overrides.
  5. Run livestate for the same application.
  6. Observe that the livestate path still uses the top-level values instead of the per-target overrides.

From the current implementation:

  • deployment/loadManifests() applies multiTarget.KustomizeVersion and multiTarget.KustomizeOptions.
  • livestate/loadManifests() always passes spec.Input.KustomizeVersion and spec.Input.KustomizeOptions directly to provider.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 kustomizeDir parity but does not apply the same per-target precedence for KustomizeVersion and KustomizeOptions.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing deployment/loadManifests() with livestate/loadManifests(), focusing on how each constructs provider.LoaderInput. Trace the top-level and multiTarget KustomizeVersion and KustomizeOptions values, then verify the livestate path follows the documented precedence for a target with overrides. Done means deployment and livestate use the same effective values for each target.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
70/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.