feat(deployment): handle paused rollouts and proportional scaling#46
Open
indyjonesnl wants to merge 1 commit into
Open
feat(deployment): handle paused rollouts and proportional scaling#46indyjonesnl wants to merge 1 commit into
indyjonesnl wants to merge 1 commit into
Conversation
Match upstream Kubernetes v1.35 deployment controller semantics for the
two conformance scenarios in Unit 8:
- Paused deployments: detect spec.paused and route through scale() only,
so the rolling-update progression (which scales the old RS down) is
skipped while paused. Scale events are still honored.
- Proportional scaling: refactor the scale path into a single
scale_replica_sets() helper mirroring k8s sync.go scale():
1. FindActiveOrLatest -> direct scale of the single active RS.
2. IsSaturated -> scale every old RS to 0.
3. Multiple active RSes -> proportional distribution using each
RS's max-replicas annotation as the denominator (GetProportion),
newest-first, with rounding leftover assigned to the new RS.
- Detect scaling events across all active RSes (not gated on
old_rs_total > 0), matching upstream isScalingEvent().
Adds 5 unit tests covering proportional distribution (active rollout +
paused), paused rollout non-progression, single-new-RS rollover, and
old-RS scale-down on rollover saturation.
K8s refs: pkg/controller/deployment/{deployment_controller,sync}.go,
pkg/controller/deployment/util/deployment_util.go.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Two Deployment features missing — both required by K8s conformance:
Fix
Verification
`cargo build --workspace --locked` clean. Depends on #32 for green CI.