Repository navigation
fix: create instances for the Parallel scale policy - #640
Merged
Merged
Conversation
A Workload with instanceManagementPolicy Parallel was accepted by the API but never got instances: the stateful control only emitted create, delete and replace actions for OrderedReady, so every other value silently did nothing. Key changes: - implement Parallel: create and delete every pending instance at once without waiting on readiness, and replace outdated instances one at a time once nothing is being created or is waiting - restrict instanceManagementPolicy to OrderedReady and Parallel at admission so unknown values are rejected instead of ignored - return an error for an unsupported policy rather than doing nothing - add unit tests for Parallel scale up, scale down and template rollout
Adding the Parallel case pushed GetActions over the linter's complexity limit, so the per-policy ordering moves into its own function. Key changes: - move the policy switch into orderRolloutActions - use a constant for the repeated test image and drop an unused test helper parameter
kevwilliams
approved these changes
Nov 11, 2026
kevwilliams
left a comment
Contributor
There was a problem hiding this comment.
Verified the executor runs every unskipped action, so Parallel creates and deletes land together, and recreates stay held behind pending creates or waits.
ecv
approved these changes
Nov 11, 2026
ecv
left a comment
Contributor
There was a problem hiding this comment.
Approve. Parallel now creates and deletes instances at once and still replaces them one at a time on a template change: any pending create or wait skips every recreate, and forcing recreates never to skip fails two Parallel tests. CRDs regenerate with no diff, and main's own stateful tests pass against this head.
- OrderedReady keeps its action order, but two edges changed. An empty policy now runs as OrderedReady where it used to produce no actions, and any value outside the new enum makes GetActions return an error where it used to stall silently.
Follow-ups:
- A Workload stored with a policy outside OrderedReady/Parallel will start failing reconciles once this ships. Check stored data before the release, and call the enum out in the release notes.
- Scale-down deletes are not counted in the recreate gate, so a scale-down and a template change in one reconcile terminate several instances at once. Intended, but untested; add a test for that case.
3 of 4 tasks
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.
Requested by Scot Schuchert-Wells · project thread
A Workload that asks for the Parallel instance management policy is accepted but never gets any instances, and nothing tells the user why. This change implements Parallel, so missing instances are created and surplus ones deleted all at once instead of one at a time waiting on readiness. Template changes still replace instances one at a time, held until nothing is being created or is waiting, matching how StatefulSets treat Parallel. The policy field now only admits OrderedReady and Parallel, and the controller returns an error for any other value instead of quietly doing nothing.
Fixes #524
Test plan
Generated by Claude Code