feat: add instance controller#66
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR implements an Instance controller to enable inplace update capability for pods managed by the same Instance. The controller provides the foundational step toward achieving inplace updates, as part of addressing issue #64.
Key changes:
- Introduces a new Instance controller with reconciliation logic for managing instances and their owned pods
- Adds revision control mechanisms for tracking instance configuration changes
- Reorganizes import paths from
pkg/utils/inplace/*topkg/inplace/*for better code structure
Reviewed Changes
Copilot reviewed 19 out of 153 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/utils/fieldindex/register.go | Adds field indexing for pod owner references to support efficient pod lookups |
| pkg/reconciler/instance/utils/instance_utils.go | Provides utility functions for pod management, selector creation, and revision handling |
| pkg/reconciler/instance/revision/instance_revision.go | Implements revision control for tracking instance configuration changes |
| pkg/reconciler/instance/instance_reconciler.go | Core reconciler implementation for Instance resources |
| pkg/reconciler/instance/instance_event_handler.go | Handles pod lifecycle events and maps them to instance reconciliation requests |
| pkg/reconciler/instance/core/instance_core.go | Contains core logic for pod creation, revision management, and update operations |
| internal/controller/workloads/instance_controller.go | Controller setup and CRD existence checks for Instance resources |
| pkg/inplace/pod/pod_util.go | Adds Instance-specific readiness gate injection and updates import paths |
| pkg/inplace/pod/inplaceupdate/inplace_update.go | Updates import paths for inplace update utilities |
| pkg/inplace/instance/readiness/instance_readiness_utils.go | Updates import paths for instance readiness utilities |
| pkg/inplace/instance/inplaceupdate/inplace_update.go | Updates import paths for instance inplace update logic |
| go.mod | Adds dependencies for kruise and kubernetes packages |
| cmd/rbgs/main.go | Integrates Instance controller into the main manager |
| api/workloads/v1alpha1/instance_types.go | Corrects API documentation comment |
| api/workloads/v1alpha1/constant.go | Adds new Instance-specific label constants and renames InstanceSet labels |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
cdbdbba to
1cc4f2b
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 29 out of 165 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
api/workloads/v1alpha1/constant.go:1
- The comment has a grammatical issue: "when Instance Ready" should be "when the Instance is ready" for proper grammar.
package v1alpha1
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a9c2958 to
a29a0e1
Compare
d8dac47 to
74b10dd
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
74b10dd to
14f3b91
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 34 out of 169 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9b01702 to
8dc7300
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 34 out of 169 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ffeb81a to
a331f27
Compare
a331f27 to
c40e10f
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 34 out of 169 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@cheyang @Syspretor @gujingit PTAL |
Ⅰ. Motivation
This PR implements the inplace update capability for the
Instance(as shown in the diagram below).Ⅱ. Modifications
Instance controller.Instance.Ⅲ. Does this pull request fix one issue?
fixes #64 & #65
Ⅳ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.
Ⅴ. Describe how to verify it
you can refer to doc/feature/instance.md for more usage.
VI. Special notes for reviews
Checklist
make fmt.