Repository navigation
chore(role-instance): implement roleInstance and roleInstanceSet as reconcile version - #191
Merged
cheyang merged 3 commits intoMar 11, 2026
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Syspretor
force-pushed
the
chore/implement-roleinstanceset-as-storageversion
branch
from
March 11, 2026 02:51
ceb3d76 to
da536d1
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the workload controllers/reconcilers from the legacy Instance/InstanceSet (workloads/v1alpha1) APIs to the reconcile implementations for RoleInstance/RoleInstanceSet (workloads/v1alpha2), including stateless/stateful modes and supporting in-place update utilities.
Changes:
- Replace controller wiring to use
RoleInstanceandRoleInstanceSetreconcilers (and removeInstance/InstanceSetcontrollers). - Port RoleInstanceSet stateless/stateful reconcile logic to v1alpha2 types, including new stateless event handler and ref manager.
- Update in-place lifecycle/readiness/specified-delete/in-place-update utilities (and related tests) to operate on v1alpha2
RoleInstance.
Reviewed changes
Copilot reviewed 49 out of 52 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/envtest/testutil/setup.go | Envtest wiring updated to use RoleInstance / RoleInstanceSet controllers. |
| pkg/reconciler/roleinstanceset/statelessmode/utils/utils.go | Switch stateless RoleInstanceSet utils to v1alpha2 + constants labels. |
| pkg/reconciler/roleinstanceset/statelessmode/utils/sorter.go | Update sorter interfaces/types to v1alpha2 RoleInstance. |
| pkg/reconciler/roleinstanceset/statelessmode/utils/ref_manager.go | New generic ref manager for adopting/releasing owned objects. |
| pkg/reconciler/roleinstanceset/statelessmode/sync/update.go | Port update logic to RoleInstanceSet/RoleInstance v1alpha2 APIs. |
| pkg/reconciler/roleinstanceset/statelessmode/sync/scale.go | Port scale logic to RoleInstanceSet/RoleInstance v1alpha2 APIs + constants. |
| pkg/reconciler/roleinstanceset/statelessmode/sync/helper.go | Port helper logic/expectation diffs to v1alpha2 naming/fields. |
| pkg/reconciler/roleinstanceset/statelessmode/sync/api.go | Update sync interface to v1alpha2 RoleInstanceSet/RoleInstance. |
| pkg/reconciler/roleinstanceset/statelessmode/status.go | Update status updater to v1alpha2 RoleInstanceSet status/types. |
| pkg/reconciler/roleinstanceset/statelessmode/revision/revision.go | Update controller revision patching to v1alpha2 templates/codec. |
| pkg/reconciler/roleinstanceset/statelessmode/reconciler.go | Port reconciler to fetch/reconcile v1alpha2 RoleInstanceSet. |
| pkg/reconciler/roleinstanceset/statelessmode/event_handler.go | New RoleInstance event handler for stateless RoleInstanceSet expectations. |
| pkg/reconciler/roleinstanceset/statelessmode/core/implement.go | Core control updated for RoleInstanceSet templates/labels/spec injection. |
| pkg/reconciler/roleinstanceset/statelessmode/core/api.go | New v1alpha2 RoleInstanceSet core control interface. |
| pkg/reconciler/roleinstanceset/statefulmode/stateful_instance_set_utils.go | Update stateful helpers to v1alpha2 RoleInstance/RoleInstanceSet. |
| pkg/reconciler/roleinstanceset/statefulmode/stateful_instance_set_status_updater.go | Update stateful status updater to v1alpha2 listers/types. |
| pkg/reconciler/roleinstanceset/statefulmode/stateful_instance_set_helper.go | Update revision helpers/status calculations to v1alpha2 types. |
| pkg/reconciler/roleinstanceset/statefulmode/stateful_instance_set_controller.go | Update informer/lister/controllerKind to v1alpha2 RoleInstanceSet/RoleInstance. |
| pkg/reconciler/roleinstanceset/statefulmode/stateful_instance_set_control.go | Update stateful control interfaces and status types to v1alpha2. |
| pkg/reconciler/roleinstanceset/statefulmode/stateful_instance_control.go | Update instance object manager to v1alpha2 RoleInstance listers/types. |
| pkg/reconciler/roleinstanceset/statefulmode/instance_ref_manager.go | Update controller-ref manager and instance ops to v1alpha2 RoleInstance. |
| pkg/reconciler/roleinstance/utils/instance_utils.go | New utils module for roleinstance reconcile flow. |
| pkg/reconciler/roleinstance/sync/instance_update.go | Update imports to roleinstance core/utils packages. |
| pkg/reconciler/roleinstance/sync/instance_scale.go | Update imports to roleinstance core/utils packages. |
| pkg/reconciler/roleinstance/sync/api.go | Update imports to roleinstance lifecycle/inplaceupdate packages. |
| pkg/reconciler/roleinstance/revision/instance_revision.go | Update imports to roleinstance core/utils packages. |
| pkg/reconciler/roleinstance/lifecycle/lifecycle_utils.go | New lifecycle helper for updating pod readiness keys. |
| pkg/reconciler/roleinstance/instance_status.go | Rename package to roleinstance and update internal imports. |
| pkg/reconciler/roleinstance/instance_reconciler.go | Rename package to roleinstance and update internal imports. |
| pkg/reconciler/roleinstance/instance_event_handler.go | Rename package to roleinstance and update internal imports. |
| pkg/reconciler/roleinstance/inplaceupdate/inplaceupdate.go | Update import to roleinstance utils. |
| pkg/reconciler/roleinstance/core/instance_core.go | Update import to roleinstance utils. |
| pkg/reconciler/instanceset/statelessmode/event_handler.go | Remove legacy InstanceSet stateless event handler (v1alpha1). |
| pkg/reconciler/instanceset/statelessmode/core/api.go | Remove legacy InstanceSet stateless core API (v1alpha1). |
| pkg/inplace/instance/specifieddelete/specified_delete.go | Switch specified-delete label + patch helper to RoleInstance v1alpha2 + constants. |
| pkg/inplace/instance/readiness/instance_readiness_utils_test.go | Update readiness tests to v1alpha2 RoleInstance types. |
| pkg/inplace/instance/readiness/instance_readiness_utils.go | Port readiness utilities to v1alpha2 RoleInstance and adapter methods. |
| pkg/inplace/instance/readiness/instance_readiness.go | Port readiness interface to v1alpha2 RoleInstance. |
| pkg/inplace/instance/lifecycle/lifecycle_utils.go | Port lifecycle utilities to v1alpha2 RoleInstance lifecycle keys/types. |
| pkg/inplace/instance/instance_util_test.go | Update instance util tests to v1alpha2 RoleInstance + constants labels. |
| pkg/inplace/instance/instance_util.go | Rename/update helpers to RoleInstance variants and constants label keys. |
| pkg/inplace/instance/inplaceupdate/inplace_update_test.go | Port in-place update tests to v1alpha2 RoleInstance and new option names. |
| pkg/inplace/instance/inplaceupdate/inplace_update_defaults_test.go | Port defaults tests to v1alpha2 template/layout and new option names. |
| pkg/inplace/instance/inplaceupdate/inplace_update_defaults.go | Port defaults implementation to v1alpha2 RoleInstance + new option names. |
| pkg/inplace/instance/inplaceupdate/inplace_update.go | Port main in-place update implementation to v1alpha2 RoleInstance and adapters. |
| pkg/inplace/instance/clientdapter/adapter.go | Rename adapter methods to RoleInstance variants and v1alpha2 types. |
| pkg/constants/label.go | Add RoleInstance label keys and component label aliases. |
| internal/controller/workloads/roleinstanceset_controller.go | New controller that dispatches RoleInstanceSet reconcile by pattern (stateful/stateless). |
| internal/controller/workloads/roleinstance_controller.go | New RoleInstance controller registration. |
| internal/controller/workloads/instanceset_controller.go | Remove legacy InstanceSet controller registration. |
| internal/controller/workloads/instance_controller.go | Remove legacy Instance controller registration. |
| cmd/rbgs/main.go | Wire manager startup to RoleInstance/RoleInstanceSet controllers instead of Instance/InstanceSet. |
Comments suppressed due to low confidence (1)
pkg/reconciler/roleinstance/instance_reconciler.go:31
- This reconciler package was renamed to roleinstance, but it still imports and reconciles the v1alpha1.Instance API. With the new internal/controller/workloads/roleinstance_controller.go registering a controller for v1alpha2.RoleInstance, this will result in a GVK mismatch (client.Get will query workloads/v1alpha1, Kind=Instance instead of workloads/v1alpha2, Kind=RoleInstance). Update the roleinstance reconciler (and its dependent core/sync/revision/status code) to use v1alpha2.RoleInstance types (and Kind="RoleInstance"), or keep the controller registration on v1alpha1 consistently.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Syspretor
force-pushed
the
chore/implement-roleinstanceset-as-storageversion
branch
from
March 11, 2026 03:34
da536d1 to
0623b12
Compare
cheyang
reviewed
Mar 11, 2026
cheyang
reviewed
Mar 11, 2026
Syspretor
force-pushed
the
chore/implement-roleinstanceset-as-storageversion
branch
from
March 11, 2026 06:10
0623b12 to
057b62d
Compare
added 2 commits
March 11, 2026 14:18
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.
…econcile version
Ⅰ. Motivation
Ⅱ. Modifications
Ⅲ. Does this pull request fix one issue?
fixes #XXXX
Ⅳ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.
Ⅴ. Describe how to verify it
VI. Special notes for reviews
Checklist
make fmt.