Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
@freeznet:Thanks for your contribution. For this PR, do we need to update docs? |
There was a problem hiding this comment.
Pull request overview
This PR improves reconciliation behavior around StreamNativeCloudConnection lifecycle by (a) making dependent resources react to connection changes and (b) preventing stuck deletions by skipping remote cleanup when the connection (or other upstream refs) is already gone.
Changes:
- Add deletion-time handling across controllers to remove finalizers when the referenced
StreamNativeCloudConnection(or workspace/SA) is missing. - Add
Watches(StreamNativeCloudConnection, ...)to enqueue reconciles for dependent resources when a connection changes. - Introduce a finalizer on
StreamNativeCloudConnectionthat blocks deletion while dependent resources still exist, plus initial unit tests for dependency listing.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| controllers/apiserverconnection_controller.go | Adds connection finalizer + dependency checks; watches dependents to re-trigger reconcile. |
| controllers/apiserverconnection_controller_test.go | Adds tests for listDependentResources. |
| controllers/workspace_controller.go | Handles missing connection on deletion; watches connection to requeue affected workspaces. |
| controllers/flinkdeployment_controller.go | Handles missing workspace/connection on deletion; watches connection and maps to affected deployments. |
| controllers/serviceaccount_controller.go | Handles missing connection on deletion; watches connection to requeue affected service accounts. |
| controllers/serviceaccountbinding_controller.go | Handles missing SA/connection on deletion; watches connection and maps direct/indirect bindings. |
| controllers/secret_controller.go | Handles missing connection on deletion; watches connection to requeue affected secrets. |
| controllers/rolebinding_controller.go | Handles missing connection on deletion; watches connection to requeue affected rolebindings. |
| controllers/apikey_controller.go | Handles missing connection on deletion; watches connection to requeue affected APIKeys. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
(If this PR fixes a github issue, please add
Fixes #<xyz>.)Fixes #
(or if this PR is one task of a github issue, please add
Master Issue: #<xyz>to link to the master issue.)Master Issue: #
Motivation
Explain here the context, and why you're making that change. What is the problem you're trying to solve.
Modifications
Describe the modifications you've done.
Verifying this change
(Please pick either of the following options)
This change is a trivial rework / code cleanup without any test coverage.
(or)
This change is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(example:)
Documentation
Check the box below.
Need to update docs?
doc-required(If you need help on updating docs, create a doc issue)
no-need-doc(Please explain why)
doc(If this PR contains doc changes)