Skip to content

fix(apiserver-resources): ignore not-found errors during deletion#386

Merged
freeznet merged 4 commits intomainfrom
fix/rolebinding-deletion-not-found
Mar 30, 2026
Merged

fix(apiserver-resources): ignore not-found errors during deletion#386
freeznet merged 4 commits intomainfrom
fix/rolebinding-deletion-not-found

Conversation

@mattisonchao
Copy link
Copy Markdown
Member

@mattisonchao mattisonchao commented Mar 27, 2026

Summary

  • When deleting API server-backed resources, if the resource doesn't exist on the cloud API server, treat it as success instead of retrying indefinitely
  • This now applies consistently to RoleBindings, ServiceAccounts, ServiceAccountBindings, APIKeys, Secrets, Workspaces, and FlinkDeployments
  • This prevents the controller from getting stuck in an error loop during helm uninstall when the remote resource was already cleaned up

Test plan

  • Reproduced with customer's 3-phase Helm install against a kind cluster with v0.18.0
  • Verified helm uninstall pulsar-rolebindings --wait completes cleanly with this fix
  • Verified RoleBindings that were never created remotely can still be deleted locally
  • Added controller regression tests covering delete-time 404 handling for ServiceAccounts, ServiceAccountBindings, APIKeys, Secrets, Workspaces, and FlinkDeployments
  • Verified the full repository test target with make test

⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.

When deleting a RoleBinding, if the resource doesn't exist on the cloud
API server, treat it as success instead of retrying indefinitely. This
prevents the controller from getting stuck in an error loop during
helm uninstall when the remote resource was already cleaned up.
@github-actions
Copy link
Copy Markdown
Contributor

@mattisonchao: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 27, 2026
@freeznet
Copy link
Copy Markdown
Member

@copilot extend the similar logics to other apiserverconnection resources, such as serviceaccounts, serviceaccountbindings, etc.

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 30, 2026

@copilot extend the similar logics to other apiserverconnection resources, such as serviceaccounts, serviceaccountbindings, etc.

Addressed in 5508bac. The branch already had the same not-found-on-delete behavior for ServiceAccounts and ServiceAccountBindings, so I added regression coverage for those controller deletion paths to lock it in and verify finalizer cleanup stays successful when the remote resource is already gone.

Copilot AI requested a review from freeznet March 30, 2026 04:07
@freeznet
Copy link
Copy Markdown
Member

@copilot currently we only handles 404 error when deletes rolebinding resources, but we need to handle the same 404 error when delete other apiserverconnection bind resources, such as serviceaccounts, serviceaccountbindings, etc.

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 30, 2026

@copilot currently we only handles 404 error when deletes rolebinding resources, but we need to handle the same 404 error when delete other apiserverconnection bind resources, such as servicea...

Addressed in c8bd207. I applied the same delete-time 404 handling across the API-server-backed reconcilers and expanded regression coverage for ServiceAccount, ServiceAccountBinding, APIKey, Secret, Workspace, and FlinkDeployment deletion paths.

Copilot AI changed the title fix(rolebinding): ignore not-found error during deletion fix(apiserver-resources): ignore not-found errors during deletion Mar 30, 2026
@freeznet freeznet merged commit 8a35103 into main Mar 30, 2026
6 checks passed
@freeznet freeznet deleted the fix/rolebinding-deletion-not-found branch March 30, 2026 09:21
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.

3 participants