Skip to content

Conversation

@billyshambrook
Copy link

Allow traffic router plugins to delay ReplicaSet scale-down until external systems have completed draining (e.g., long-running connections, worker versioning, message queue consumers).

The hook is checked before scaling down:

  • Intermediate ReplicaSets during interrupted updates (rainbow deployments)
  • ReplicaSets after scale-down deadline has passed
  • ReplicaSets when exceeding scaleDownDelayRevisionLimit

... am leaving this ready if the enhancement issue is approved, I already had it coded up so thought I would open the PR now just in case :)

Closes #4597

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this is a chore.
  • The title of the PR is (a) conventional with a list of types and scopes found here, (b) states what changed, and (c) suffixes the related issues number. E.g. "fix(controller): Updates such and such. Fixes #1234".
  • I've signed my commits with DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My builds are green. Try syncing with master if they are not.
  • My organization is added to USERS.md.

Allow traffic router plugins to delay ReplicaSet scale-down until
external systems have completed draining (e.g., long-running connections,
worker versioning, message queue consumers).

The hook is checked before scaling down:
- Intermediate ReplicaSets during interrupted updates (rainbow deployments)
- ReplicaSets after scale-down deadline has passed
- ReplicaSets when exceeding scaleDownDelayRevisionLimit

Signed-off-by: Billy Shambrook <[email protected]>
@billyshambrook billyshambrook marked this pull request as draft January 19, 2026 23:13
@github-actions
Copy link
Contributor

github-actions bot commented Jan 19, 2026

Published E2E Test Results

  4 files    4 suites   3h 25m 44s ⏱️
117 tests 108 ✅  7 💤 2 ❌
470 runs  440 ✅ 28 💤 2 ❌

For more details on these failures, see this check.

Results for commit 19f77a0.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 19, 2026

Published Unit Test Results

2 389 tests   2 389 ✅  3m 10s ⏱️
  129 suites      0 💤
    1 files        0 ❌

Results for commit 19f77a0.

♻️ This comment has been updated with latest results.

- Emit Kubernetes events for errors (matching VerifyWeight pattern)
- Remove call-site error logging in favor of centralized event handling
- Fix mock ordering for codegen compliance
- Fix test fixtures with missing services and action expectations

Signed-off-by: Billy Shambrook <[email protected]>
@sonarqubecloud
Copy link

@codecov
Copy link

codecov bot commented Jan 20, 2026

Codecov Report

❌ Patch coverage is 45.63107% with 56 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.17%. Comparing base (b9a8811) to head (19f77a0).

Files with missing lines Patch % Lines
rollout/trafficrouting/plugin/rpc/rpc.go 5.26% 18 Missing ⚠️
utils/plugin/types/types.go 7.69% 12 Missing ⚠️
rollout/replicaset.go 83.33% 4 Missing and 3 partials ⚠️
rollout/trafficrouting/plugin/plugin.go 0.00% 5 Missing ⚠️
rollout/trafficrouting/ambassador/ambassador.go 0.00% 2 Missing ⚠️
rollout/trafficrouting/apisix/apisix.go 0.00% 2 Missing ⚠️
rollout/trafficrouting/appmesh/appmesh.go 0.00% 2 Missing ⚠️
rollout/trafficrouting/nginx/nginx.go 0.00% 2 Missing ⚠️
...afficrouting/plugin/rpc/rpc_test_implementation.go 0.00% 2 Missing ⚠️
rollout/trafficrouting/smi/smi.go 0.00% 2 Missing ⚠️
... and 1 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4598      +/-   ##
==========================================
- Coverage   84.37%   84.17%   -0.21%     
==========================================
  Files         164      164              
  Lines       18845    18948     +103     
==========================================
+ Hits        15901    15950      +49     
- Misses       2079     2131      +52     
- Partials      865      867       +2     

☔ 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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Traffic Router Plugin hook to delay ReplicaSet scale-down until external drain completes

1 participant