Skip to content

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

Merged
Warashi merged 4 commits into
pipe-cd:masterfrom
mohammedfirdouss:feat/fix-livestate-loadmanifests
May 24, 2026
Merged

[Multi_K8s-Plugin] Fix livestate loadManifests to stamp tracking labels and honour kustomizeDir#6783
Warashi merged 4 commits 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 36.41%. Comparing base (215ea40) to head (11b5bd8).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6783      +/-   ##
==========================================
+ Coverage   29.33%   36.41%   +7.07%     
==========================================
  Files         598       97     -501     
  Lines       63902     7981   -55921     
==========================================
- Hits        18744     2906   -15838     
+ Misses      43711     4916   -38795     
+ Partials     1447      159    -1288     
Flag Coverage Δ
. ?
.-pkg-app-pipedv1-plugin-analysis 32.43% <ø> (ø)
.-pkg-app-pipedv1-plugin-ecs 31.82% <ø> (ø)
.-pkg-app-pipedv1-plugin-kubernetes ?
.-pkg-app-pipedv1-plugin-kubernetes_multicluster ?
.-pkg-app-pipedv1-plugin-scriptrun 54.83% <ø> (ø)
.-pkg-app-pipedv1-plugin-terraform 37.95% <ø> (ø)
.-pkg-app-pipedv1-plugin-wait 33.04% <ø> (ø)
.-pkg-app-pipedv1-plugin-waitapproval 52.71% <ø> (ø)
.-pkg-plugin-sdk 50.34% <ø> (ø)
.-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.

Copy link
Copy Markdown
Member

@Warashi Warashi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Warashi Warashi merged commit 7762bd5 into pipe-cd:master May 24, 2026
45 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

Thank you for contributing to PipeCD! The changes in this pull request will be part of the upcoming release!

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

2 participants