Skip to content

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

Merged
Warashi merged 6 commits into
pipe-cd:masterfrom
mohammedfirdouss:feat/multicluster-per-stage-multitarget-filtering
May 24, 2026
Merged

[Multi_K8s-Plugin] Add per-stage multiTarget filtering#6757
Warashi merged 6 commits into
pipe-cd:masterfrom
mohammedfirdouss:feat/multicluster-per-stage-multitarget-filtering

Conversation

@mohammedfirdouss

@mohammedfirdouss mohammedfirdouss commented May 9, 2026

Copy link
Copy Markdown
Contributor

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

codecov Bot commented May 9, 2026

Copy link
Copy Markdown

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.

Warashi
Warashi previously approved these changes May 23, 2026

@Warashi Warashi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is a great feature!
LGTM

@mohammedfirdouss

Copy link
Copy Markdown
Contributor Author

This is a great feature! LGTM

Thanks!!

@Warashi

Warashi commented May 24, 2026

Copy link
Copy Markdown
Member

@mohammedfirdouss sorry, please resolve conflicts?

@mohammedfirdouss

Copy link
Copy Markdown
Contributor Author

@mohammedfirdouss sorry, please resolve conflicts?

Ok,on it.

…ltering

Signed-off-by: Mohammed Firdous <124298708+mohammedfirdouss@users.noreply.github.com>

@Warashi Warashi left a comment

Copy link
Copy Markdown
Member

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 b043971 into pipe-cd:master May 24, 2026
27 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.

2 participants