Fix #16260: Allow unreachable revisions with initialScale > 1 to scale to 0 #16327
+16
−1
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.
Revisions with initialScale > 1 that are no longer referenced by any Route (routingState = 'reserve', mapped to Reachability = Unreachable) were previously unable to scale down to 0, causing resource waste when old revisions were replaced by new ones.
This change modifies the initialScale logic in scaler.go to ignore the initialScale constraint when a revision's Reachability is Unreachable. This allows revisions in reserve state to scale down to 0 immediately, freeing up resources promptly when they are no longer needed.
The fix adds a check for pa.Spec.Reachability != ReachabilityUnreachable before applying the initialScale constraint, ensuring that:
A new test case has been added to verify the behavior: revisions with initialScale > 1 and Reachability = Unreachable can now scale to 0.
Fixes #16260
Proposed Changes
Release Note