fix: sts_reconciler failure to retrieve historical StatefulSet revisions#77
Merged
Syspretor merged 1 commit intosgl-project:mainfrom Oct 28, 2025
Merged
fix: sts_reconciler failure to retrieve historical StatefulSet revisions#77Syspretor merged 1 commit intosgl-project:mainfrom
Syspretor merged 1 commit intosgl-project:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug in the StatefulSet reconciler where historical ControllerRevision resources could not be retrieved due to an incorrect label selector. The fix aligns the revision listing logic with the Pod retrieval logic, matching Kubernetes' StatefulSet controller behavior.
Key Changes:
- Updated
getHighestRevisionto use pod selector instead of role common labels for listing ControllerRevisions - Removed
roleCommonLabelsparameter fromrollingUpdateParametersandgetReplicaStatesmethods - Fixed test method call to use correct service name retrieval method
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pkg/reconciler/sts_reconciler.go | Removed roleCommonLabels parameter and updated getHighestRevision to use podSelector for proper ControllerRevision retrieval |
| pkg/reconciler/sts_reconciler_test.go | Updated test to match new method signature without roleCommonLabels parameter |
| test/e2e/framework/workloads/statefulset_expect.go | Fixed method call to use GetServiceName instead of GetWorkloadName |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Syspretor
approved these changes
Oct 28, 2025
Collaborator
|
/lgtm |
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.
Ⅰ. Motivation
fix: sts_reconciler failure to retrieve historical StatefulSet revisions
Ⅱ. Modifications
Align sts_reconciler StatefulSet revision listing label selector with available Pod retrieval logic, following StatefulSet controller’s revision creation behavior
https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/statefulset/stateful_set_utils.go#L576-L581
RBG StatefulSet PodTemplate Label
https://github.com/sgl-project/rbg/blob/main/pkg/reconciler/sts_reconciler.go#L473-L474
Ⅲ. Does this pull request fix one issue?
fixes #76
Ⅳ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.
[AfterSuite] PASSED [0.031 seconds]
Ran 28 of 28 Specs in 133.556 seconds
SUCCESS! -- 28 Passed | 0 Failed | 0 Pending | 0 Skipped
--- PASS: TestE2E (133.56s)
PASS
ok sigs.k8s.io/rbgs/test/e2e 134.100s
Ⅴ. Describe how to verify it
#76
VI. Special notes for reviews
Checklist
make fmt.