Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: orphan rbac resources instead of deleting #9010

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cjc7373
Copy link
Contributor

@cjc7373 cjc7373 commented Mar 6, 2025

fixes #8941. Specifically, this PR tries to fix a stale read condition described in #8941 (comment)

One drawback is rbac resource won't be automactically cleaned up.

@cjc7373 cjc7373 requested a review from a team as a code owner March 6, 2025 06:46
@github-actions github-actions bot added the size/L Denotes a PR that changes 100-499 lines. label Mar 6, 2025
Copy link

codecov bot commented Mar 6, 2025

Codecov Report

Attention: Patch coverage is 57.14286% with 12 lines in your changes missing coverage. Please review.

Project coverage is 60.20%. Comparing base (0cc67d0) to head (afb8975).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...s/apps/component/transformer_component_deletion.go 65.21% 5 Missing and 3 partials ⚠️
...llers/apps/component/transformer_component_rbac.go 20.00% 0 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9010      +/-   ##
==========================================
+ Coverage   60.03%   60.20%   +0.16%     
==========================================
  Files         390      390              
  Lines       46553    46675     +122     
==========================================
+ Hits        27948    28099     +151     
+ Misses      15909    15883      -26     
+ Partials     2696     2693       -3     
Flag Coverage Δ
unittests 60.20% <57.14%> (+0.16%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

}
graphCli model.GraphClient, dag *graph.DAG, matchLabels map[string]string) (err error) {
// orphan a rbac resource so that it can be adopted by another component
// this means these resources won't get automatically deleted
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the proper cleanup method to delete these resources? Without implementing a cleanup strategy, resource remnants will persist. For instance, when users attempt to delete namespaces or perform similar cleanup operations, the process will be blocked due to these lingering resources.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it won't. Only when there's a finalizer existing in the resource, can it block the deletion process. Otherwise, resources will be automatically deleted when a namespace is deleted.

Copy link
Collaborator

Choose a reason for hiding this comment

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

No, it won't. Only when there's a finalizer existing in the resource, can it block the deletion process. Otherwise, resources will be automatically deleted when a namespace is deleted.

Oh, I see you've removed the finalizer. Perhaps later we could consider adding a new controller to manage resources at the namespace level.

@apecloud-bot apecloud-bot added the approved PR Approved Test label Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved PR Approved Test size/L Denotes a PR that changes 100-499 lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] redis cluster create error shardings.shard.phase Unsupported value: Abnormal
3 participants