Skip to content

fix: StreamNativeCloudConnection reconcile#382

Open
freeznet wants to merge 5 commits intomainfrom
freeznet/fix-snconnection-reconcile
Open

fix: StreamNativeCloudConnection reconcile#382
freeznet wants to merge 5 commits intomainfrom
freeznet/fix-snconnection-reconcile

Conversation

@freeznet
Copy link
Member

(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

  • Make sure that the change passes the CI checks.

(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:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

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)

@freeznet freeznet self-assigned this Mar 17, 2026
@freeznet freeznet requested review from a team as code owners March 17, 2026 03:13
@freeznet freeznet requested a review from Copilot March 17, 2026 03:13
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions
Copy link
Contributor

@freeznet:Thanks for your contribution. For this PR, do we need to update docs?
(The PR template contains info about doc, which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)

@github-actions github-actions bot added the doc-info-missing This pr needs to mark a document option in description label Mar 17, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 StreamNativeCloudConnection that 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-info-missing This pr needs to mark a document option in description

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants