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: Read kubeconfig first even with --bootstrap-kubeconfig flag #606

Merged
merged 1 commit into from
Jul 5, 2022
Merged

Fix: Read kubeconfig first even with --bootstrap-kubeconfig flag #606

merged 1 commit into from
Jul 5, 2022

Conversation

dharmjit
Copy link
Contributor

What this PR does / why we need it:
In the exisitng implementation, If the user passes the --bootstrap-kubeconfig in repeated invocations of the agent in the same host, the code flow is to create CSR again, but the k8s API k8s.io/client-go/util/certificate/csr.RequestCertificate tries to use the existing CSR and it will fail due to Certificate Key mismatch. With this PR, kubeconfig if existing as ~/.byoh/config will be used even with the --bootstrap-kubeconfig flag passed.

Which issue(s) this PR fixes :
Fixes #598

@dharmjit dharmjit marked this pull request as draft June 21, 2022 11:09
@dharmjit dharmjit marked this pull request as ready for review June 28, 2022 03:55
@shivi28
Copy link
Contributor

shivi28 commented Jun 28, 2022

LGTM 👍

Copy link
Contributor

@mayur-tolexo mayur-tolexo left a comment

Choose a reason for hiding this comment

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

Small nit, overall LGTM

agent/host_agent_test.go Show resolved Hide resolved
@dharmjit dharmjit merged commit e126fab into vmware-tanzu:main Jul 5, 2022
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.

Ignore --bootstrap-kubeconfig flag when config file already present
5 participants