-
Notifications
You must be signed in to change notification settings - Fork 96
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 gc controller not handle empty cluster #812
🐛 fix gc controller not handle empty cluster #812
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #812 +/- ##
==========================================
- Coverage 63.84% 63.80% -0.04%
==========================================
Files 193 193
Lines 18674 18667 -7
==========================================
- Hits 11922 11911 -11
- Misses 5772 5774 +2
- Partials 980 982 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
/assign @qiujian16 |
7476293
to
218ce22
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good in general. Can we add an integration test?
a488232
to
43bcd65
Compare
@qiujian16 added a case that cluster is gone in the gc integration tests. |
Signed-off-by: Zhiwei Yin <[email protected]>
/lgtm |
var copyCluster *clusterv1.ManagedCluster | ||
if cluster != nil { | ||
if cluster.DeletionTimestamp.IsZero() { | ||
_, err = r.clusterPatcher.AddFinalizer(ctx, cluster, clusterv1.ManagedClusterFinalizer) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with this finalizer, why is it possible the cluster was deleted before resource cleanup?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a case that will remove the finalizer after delete the rbac when gc feature gate is disable, but the finalizer of work rolebinding can only be removed after all works are deleted. in this case the cluster may be gone.
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: qiujian16, zhiweiyin318 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
b6c2a84
into
open-cluster-management-io:main
Summary
the gc controller returned when cluster is empty, and the work rolebinding is left over.
this PR will handle the case that cluster is empty in gc controller.
Related issue(s)
Fixes #