Skip to content

[Multi_K8s-Plugin] Fix livestate loadManifests to stamp tracking labels and honour kustomizeDir#6783

Open
mohammedfirdouss wants to merge 1 commit into
pipe-cd:masterfrom
mohammedfirdouss:feat/fix-livestate-loadmanifests
Open

[Multi_K8s-Plugin] Fix livestate loadManifests to stamp tracking labels and honour kustomizeDir#6783
mohammedfirdouss wants to merge 1 commit into
pipe-cd:masterfrom
mohammedfirdouss:feat/fix-livestate-loadmanifests

Conversation

@mohammedfirdouss
Copy link
Copy Markdown
Contributor

@mohammedfirdouss mohammedfirdouss commented May 17, 2026

What this PR does:
Fixes loadManifests in livestate/plugin.go to match what deployment/plugin.go already does:

  1. Honours kustomizeDir from the per-target multiTarget config previously the field was ignored, so kustomize overlay directories set per-target had no effect in livestate.
  2. Stamps the standard tracking labels and annotations (LabelManagedBy, LabelPiped, LabelApplication, LabelCommitHash, LabelOriginalAPIVersion, LabelResourceKey) on every loaded manifest previously these were missing, causing a divergence between the manifests the deployment plugin applies and the manifests livestate uses for drift detection.

Why we need it:
The deployment and livestate plugins use separate loadManifests implementations that had diverged. Missing labels in the livestate version meant drift detection compared against manifests that lacked the builtin PipeCD tracking labels, potentially causing false drift reports or missed drift. Missing kustomizeDir meant per-target kustomize overlays were silently ignored during livestate checks.

Which issue(s) this PR fixes:

Fixes #6446

Does this PR introduce a user-facing change?:

  • How are users affected by this change: Livestate drift detection becomes more accurate, it now compares against manifests with the same labels and overlays that were actually applied.
  • Is this breaking change: No
  • How to migrate (if breaking change): N/A

…izeDir in livestate loadManifests

Signed-off-by: Mohammed Firdous <124298708+mohammedfirdouss@users.noreply.github.com>
@mohammedfirdouss mohammedfirdouss force-pushed the feat/fix-livestate-loadmanifests branch from e4ad1bb to c8a3dc8 Compare May 17, 2026 07:53
@codecov
Copy link
Copy Markdown

codecov Bot commented May 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 17.50%. Comparing base (5df1ef3) to head (c8a3dc8).

❗ There is a different number of reports uploaded between BASE (5df1ef3) and HEAD (c8a3dc8). Click for more details.

HEAD has 24 uploads less than BASE
Flag BASE (5df1ef3) HEAD (c8a3dc8)
.-tool-actions-plan-preview 2 0
.-tool-codegen-protoc-gen-auth 2 1
.-tool-actions-gh-release 2 1
.-pkg-app-pipedv1-plugin-waitapproval 2 0
.-pkg-app-pipedv1-plugin-scriptrun 2 0
.-pkg-app-pipedv1-plugin-ecs 2 0
.-pkg-app-pipedv1-plugin-terraform 2 0
.-pkg-app-pipedv1-plugin-wait 2 0
.-pkg-plugin-sdk 2 0
.-pkg-app-pipedv1-plugin-analysis 2 0
.-pkg-app-pipedv1-plugin-kubernetes 2 0
.-pkg-app-pipedv1-plugin-kubernetes_multicluster 2 0
. 2 0
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #6783       +/-   ##
===========================================
- Coverage   29.33%   17.50%   -11.84%     
===========================================
  Files         598        7      -591     
  Lines       63902      920    -62982     
===========================================
- Hits        18744      161    -18583     
+ Misses      43711      738    -42973     
+ Partials     1447       21     -1426     
Flag Coverage Δ
. ?
.-pkg-app-pipedv1-plugin-analysis ?
.-pkg-app-pipedv1-plugin-ecs ?
.-pkg-app-pipedv1-plugin-kubernetes ?
.-pkg-app-pipedv1-plugin-kubernetes_multicluster ?
.-pkg-app-pipedv1-plugin-scriptrun ?
.-pkg-app-pipedv1-plugin-terraform ?
.-pkg-app-pipedv1-plugin-wait ?
.-pkg-app-pipedv1-plugin-waitapproval ?
.-pkg-plugin-sdk ?
.-tool-actions-gh-release 19.23% <ø> (ø)
.-tool-actions-plan-preview ?
.-tool-codegen-protoc-gen-auth 0.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

[LFX Mentorship T-1 2026] Kubernetes Multi-Cluster Plugin #6446

1 participant