Skip to content

[Multi_K8s-Plugin] Add per-stage multiTarget filtering#6757

Open
mohammedfirdouss wants to merge 1 commit intopipe-cd:masterfrom
mohammedfirdouss:feat/multicluster-per-stage-multitarget-filtering
Open

[Multi_K8s-Plugin] Add per-stage multiTarget filtering#6757
mohammedfirdouss wants to merge 1 commit intopipe-cd:masterfrom
mohammedfirdouss:feat/multicluster-per-stage-multitarget-filtering

Conversation

@mohammedfirdouss
Copy link
Copy Markdown
Contributor

@mohammedfirdouss mohammedfirdouss commented May 9, 2026

What this PR does / Why we need it:

Allows each pipeline stage in the kubernetes_multicluster plugin to declare which deploy targets it applies to via a multiTargets list in the stage options. If the list is empty the stage applies to all targets as before, so existing configs are unaffected.

Without this, every stage always runs on all targets. Users cannot do progressive multi-cluster delivery like canary to one cluster first, wait for approval, then roll out to others.

With this change:

pipeline:
  stages:
    - name: K8S_MULTI_CANARY_ROLLOUT
      with:
        replicas: 10%
        multiTargets:
          - cluster-us
    - name: K8S_MULTI_WAIT_APPROVAL
    - name: K8S_MULTI_CANARY_ROLLOUT
      with:
        replicas: 10%
        multiTargets:
          - cluster-eu
    - name: K8S_MULTI_PRIMARY_ROLLOUT

Which issue(s) this PR fixes:

Part of #6446

How was this tested:

  • Added TestFilterStageTargets to deployment/misc_test.go with 5 cases: empty filter returns all targets, single target selected, multiple targets selected, unknown target name silently ignored, mix of known and unknown names.

Signed-off-by: Mohammed Firdous <124298708+mohammedfirdouss@users.noreply.github.com>
@mohammedfirdouss mohammedfirdouss force-pushed the feat/multicluster-per-stage-multitarget-filtering branch from eae0e55 to 843c84f Compare May 9, 2026 22:29
@codecov
Copy link
Copy Markdown

codecov Bot commented May 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 37.52%. Comparing base (e37df69) to head (843c84f).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6757      +/-   ##
==========================================
+ Coverage   29.33%   37.52%   +8.19%     
==========================================
  Files         598       94     -504     
  Lines       63902     7677   -56225     
==========================================
- Hits        18744     2881   -15863     
+ Misses      43711     4651   -39060     
+ Partials     1447      145    -1302     
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 ?
.-tool-actions-plan-preview 25.51% <ø> (ø)
.-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.

1 participant