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

🐛 Regenerate the hub kubeconfig secret if the cluster name of the current context changes #473

Conversation

zhujian7
Copy link
Member

Summary

Related issue(s)

Fixes #

@openshift-ci openshift-ci bot requested review from ldpliu and skeeey May 21, 2024 09:52
@zhujian7
Copy link
Member Author

/cc @elgnay @qiujian16

@openshift-ci openshift-ci bot requested review from elgnay and qiujian16 May 22, 2024 09:28
@zhujian7
Copy link
Member Author

/hold

Copy link

codecov bot commented May 22, 2024

Codecov Report

Attention: Patch coverage is 60.00000% with 10 lines in your changes are missing coverage. Please review.

Project coverage is 62.71%. Comparing base (a148049) to head (4548a3d).

Files Patch % Lines
pkg/registration/spoke/spokeagent.go 37.50% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #473      +/-   ##
==========================================
- Coverage   62.72%   62.71%   -0.01%     
==========================================
  Files         136      136              
  Lines       11573    11578       +5     
==========================================
+ Hits         7259     7261       +2     
- Misses       3546     3549       +3     
  Partials      768      768              
Flag Coverage Δ
unit 62.71% <60.00%> (-0.01%) ⬇️

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.

@zhujian7 zhujian7 force-pushed the rebootstrap-clusterinfo branch from 8513589 to 657dc12 Compare May 22, 2024 09:49
Copy link
Member

@qiujian16 qiujian16 left a comment

Choose a reason for hiding this comment

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

I think we need an integration or e2e to test the cluster name change

pkg/registration/spoke/spokeagent.go Outdated Show resolved Hide resolved
…nt context changes

Signed-off-by: zhujian <jiazhu@redhat.com>
@zhujian7 zhujian7 force-pushed the rebootstrap-clusterinfo branch from 657dc12 to ad2f9e0 Compare May 23, 2024 03:44
@qiujian16
Copy link
Member

FYI @xuezhaojun this should also be considered in your PR

@@ -236,11 +236,12 @@ func (o *SpokeAgentConfig) RunSpokeAgentWithSpokeInformers(ctx context.Context,
managementKubeClient, 10*time.Minute, informers.WithNamespace(o.agentOptions.ComponentNamespace))

// create a kubeconfig with references to the key/cert files in the same secret
srever, proxyURL, caData, err := parseKubeconfig(o.registrationOption.BootstrapKubeconfig)
contextClusterName, srever, proxyURL, caData, err := parseKubeconfig(o.registrationOption.BootstrapKubeconfig)
Copy link
Contributor

Choose a reason for hiding this comment

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

srever -> server

@elgnay
Copy link
Contributor

elgnay commented May 23, 2024

/lgtm

Signed-off-by: zhujian <jiazhu@redhat.com>
@openshift-ci openshift-ci bot removed the lgtm label May 23, 2024
@qiujian16
Copy link
Member

/approve
/lgtm

Copy link
Contributor

openshift-ci bot commented May 23, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: qiujian16, zhujian7

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

@zhujian7
Copy link
Member Author

/unhold

@openshift-merge-bot openshift-merge-bot bot merged commit 66d4e78 into open-cluster-management-io:main May 23, 2024
14 checks passed
zhujian7 added a commit to zhujian7/ocm that referenced this pull request Jun 4, 2024
…rent context changes (open-cluster-management-io#473)

* Regenerate the hub kubeconfig secret if the cluster name of the current context changes

Signed-off-by: zhujian <jiazhu@redhat.com>

* Add an integration test

Signed-off-by: zhujian <jiazhu@redhat.com>

---------

Signed-off-by: zhujian <jiazhu@redhat.com>
openshift-merge-bot bot pushed a commit to stolostron/ocm that referenced this pull request Jun 5, 2024
…rent context changes (open-cluster-management-io#473) (#71)

* Regenerate the hub kubeconfig secret if the cluster name of the current context changes



* Add an integration test



---------

Signed-off-by: zhujian <jiazhu@redhat.com>
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.

3 participants