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

Export k3k cluster kubeconfig in k3kcli #36

Merged
merged 2 commits into from
Jun 13, 2023

Conversation

galal-hussein
Copy link
Collaborator

@galal-hussein galal-hussein commented May 15, 2023


logrus.Infof("Extracting Kubeconfig for [%s] cluster", name)
var kubeconfig []byte
err = retry.OnError(backoff, apierrors.IsNotFound, func() error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Generally don't want to reuse the err var for a few safety reasons. it's best to scope lock it in the "if".

ClientKeyData: config.KeyData,
}

clientConfig := clientcmdapi.Config{
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
clientConfig := clientcmdapi.Config{
return clientcmdapi.Config{

Copy link
Contributor

@briandowns briandowns left a comment

Choose a reason for hiding this comment

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

All of this looks fine. Let's merge. We can address this stuff in later PRs.

@galal-hussein galal-hussein merged commit 43d7779 into main Jun 13, 2023
@galal-hussein galal-hussein deleted the export_kubeconfig_k3kcli branch June 23, 2023 18:34
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