feat(scaling-adapter): add readyReplicas to RBGSA with sole-writer pattern#243
Merged
Syspretor merged 2 commits intosgl-project:mainfrom Apr 13, 2026
Merged
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
1cfd329 to
9a0c5e3
Compare
Collaborator
|
@sebest Pls fix the conflict issue. Thanks. |
16e1802 to
bda3ac8
Compare
Contributor
Author
51931f8 to
98321b5
Compare
…ttern Add readyReplicas field to RBGSA status, synced from RBG role status. Extract RBG watch predicate into named RBGRoleStatusPredicate function. Use ToRoleBasedGroupScalingAdapterStatusApplyConfiguration to preserve existing status fields during readyReplicas sync. Add comprehensive unit tests covering all new code paths: - Bind path with/without roleStatus - Steady-state sync (nil→value, stale→updated, no-op, patch error, roleStatus not found) - readyReplicas sync + scale in same reconcile - mapRBGToScalingAdapters (happy path, wrong type, list error, no adapters) - RBGRoleStatusPredicate (all 4 event funcs: create, update, delete, generic)
98321b5 to
0294e2d
Compare
Contributor
Author
|
@cheyang Any remaining blocker ? |
Collaborator
The v1alpha1 API is frozen and no longer evolving. Remove the readyReplicas field, printcolumn, deepcopy, and apply configuration additions from v1alpha1, keeping them only in v1alpha2. Addresses review feedback on PR sgl-project#243.
Contributor
Author
|
@Syspretor I removed the changes to the v1alpha1 API. thanks |
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.
Summary
status.readyReplicasfield to the RoleBasedGroupScalingAdapter CRD (v1alpha1 + v1alpha2), mirrored from the parent RBG'sstatus.roleStatuses[].readyReplicasRBGRoleStatusPredicate()function for independent testabilityTest plan
make fmt vetpassesgo test ./internal/controller/workloads/passes (all 16 new sub-tests pass)TestRoleBasedGroupScalingAdapterReconciler_ReadyReplicasSynccovers nil→value, stale→updated, no-op, roleStatus-not-found, and patch-error casesTestReadyReplicasSyncWithScaleverifies readyReplicas preserved when scale occurs in same reconcileTestRoleBasedGroupScalingAdapterReconciler_Reconcileupdated with bind-path-without-roleStatus caseTestMapRBGToScalingAdapterscovers happy path, wrong type, list error, no adaptersTestRBGRoleStatusPredicatecovers RoleStatuses changed/unchanged and wrong type