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

🐛 should use hubClient instead of bootstrapClient for a creatingClusterController. #301

Conversation

xuezhaojun
Copy link
Member

Summary

The controller resync every 1 min through the life-cycle of the registration-agent, but the bootstrapkubeconfig is expected to be a short-term thing.

Related issue(s)

Fixes #

@openshift-ci openshift-ci bot requested review from elgnay and ldpliu October 28, 2023 12:37
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 28, 2023

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: xuezhaojun
Once this PR has been reviewed and has the lgtm label, please assign elgnay for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@codecov
Copy link

codecov bot commented Oct 28, 2023

Codecov Report

Attention: 14 lines in your changes are missing coverage. Please review.

Comparison is base (9aaa132) 61.15% compared to head (aa1d42b) 61.42%.
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #301      +/-   ##
==========================================
+ Coverage   61.15%   61.42%   +0.26%     
==========================================
  Files         129      132       +3     
  Lines       13661    13855     +194     
==========================================
+ Hits         8354     8510     +156     
- Misses       4547     4582      +35     
- Partials      760      763       +3     
Flag Coverage Δ
unit 61.42% <0.00%> (+0.26%) ⬆️

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

Files Coverage Δ
pkg/registration/spoke/spokeagent.go 15.00% <0.00%> (-0.45%) ⬇️

... and 10 files with indirect coverage changes

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

Signed-off-by: xuezhaojun <zxue@redhat.com>
@xuezhaojun
Copy link
Member Author

/assign @qiujian16

@xuezhaojun xuezhaojun changed the title 🐛 should use hubClient for a constant controller. 🐛 should use hubClient instead of bootstrapClient for a creatingClusterController. Oct 30, 2023
@qiujian16
Copy link
Member

qiujian16 commented Oct 30, 2023

/assign @skeeey

I do not remember whether we want creating cluster using hub kubeconfig (I thought it was desired) and if it has the permission to do that.

@xuezhaojun
Copy link
Member Author

/assign @skeeey

I do not remember whether we want creating cluster using hub kubeconfig (I thought it was desired) and if it has the permission to do that.

Double check the code:

// ManagedCluster is only allowed created during bootstrap. After bootstrap secret expired, an unauthorized error will be got, output log at the debug level
if err != nil && skipUnauthorizedError(err) == nil {
klog.V(4).Infof("unable to get the managed cluster %q from hub: %v", c.clusterName, err)
return nil
}

It seems although the controller will live, it won't function after the bootstrap stage.

Then no need to using hubClient, PR close.

@xuezhaojun xuezhaojun closed this Oct 30, 2023
@xuezhaojun xuezhaojun deleted the fix-wrong-client branch December 19, 2023 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants