Skip to content

🌱 refator gc and move rbac deletion to cluster controller #831

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

Conversation

zhiweiyin318
Copy link
Member

Summary

Related issue(s)

Fixes #

Copy link

codecov bot commented Feb 13, 2025

Codecov Report

Attention: Patch coverage is 67.74194% with 30 lines in your changes missing coverage. Please review.

Project coverage is 63.69%. Comparing base (0153747) to head (01946bd).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/registration/hub/managedcluster/controller.go 60.71% 18 Missing and 4 partials ⚠️
pkg/registration/hub/gc/controller.go 66.66% 5 Missing and 1 partial ⚠️
pkg/registration/hub/gc/gc_resources.go 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #831      +/-   ##
==========================================
- Coverage   63.74%   63.69%   -0.05%     
==========================================
  Files         194      193       -1     
  Lines       18888    18840      -48     
==========================================
- Hits        12040    12001      -39     
- Misses       5859     5861       +2     
+ Partials      989      978      -11     
Flag Coverage Δ
unit 63.69% <67.74%> (-0.05%) ⬇️

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.

@zhiweiyin318 zhiweiyin318 force-pushed the refactor-gc-rbac branch 3 times, most recently from 45cbb5a to a65f7d5 Compare February 14, 2025 09:31
@zhiweiyin318
Copy link
Member Author

/assign @qiujian16
/assign @elgnay
/assign @zhujian7

}
}

requeue, gcErr := r.gcResourcesController.reconcile(ctx, copyCluster, clusterName)
Copy link
Member

Choose a reason for hiding this comment

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

since we already have the requeue error type defined. We could return requeue error from the reconciler.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@@ -105,8 +130,21 @@ func (c *managedClusterController) sync(ctx context.Context, syncCtx factory.Syn
newManagedCluster := managedCluster.DeepCopy()

if !managedCluster.DeletionTimestamp.IsZero() {
// the cleanup job is moved to gc controller
return nil
requeue, err := c.removeClusterRbac(ctx, managedClusterName, true)
Copy link
Member

Choose a reason for hiding this comment

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

I think we should run cleanup in approver at first, then removeClusterRBAC. Also use requeu error.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@qiujian16
Copy link
Member

/approve
/lgtm

@openshift-ci openshift-ci bot added the lgtm label Feb 19, 2025
Copy link
Contributor

openshift-ci bot commented Feb 19, 2025

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit b94d7da into open-cluster-management-io:main Feb 19, 2025
15 checks passed
zhiweiyin318 added a commit to zhiweiyin318/ocm that referenced this pull request Feb 25, 2025
zhiweiyin318 added a commit to zhiweiyin318/ocm that referenced this pull request Feb 27, 2025
openshift-merge-bot bot pushed a commit to stolostron/ocm that referenced this pull request Mar 3, 2025
openshift-merge-bot bot pushed a commit to stolostron/ocm that referenced this pull request Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants