Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

Commit

Permalink
Update kubeconfig when --kubie is set (#610)
Browse files Browse the repository at this point in the history
  • Loading branch information
marians committed Mar 1, 2021
1 parent b69a1a6 commit 82bfcd4
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions commands/create/kubeconfig/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -591,17 +591,17 @@ func createKubeconfig(ctx context.Context, args Arguments) (createKubeconfigResu
result.contextName = "giantswarm-" + clusterID
}

// edit kubectl config
if err := util.KubectlSetCluster(clusterID, result.apiEndpoint, result.caCertPath); err != nil {
return result, microerror.Mask(util.CouldNotSetKubectlClusterError)
}
if err := util.KubectlSetCredentials(clusterID, result.clientKeyPath, result.clientCertPath); err != nil {
return result, microerror.Mask(util.CouldNotSetKubectlCredentialsError)
}
if err := util.KubectlSetContext(result.contextName, clusterID); err != nil {
return result, microerror.Mask(util.CouldNotSetKubectlContextError)
}
if !args.useKubie {
// edit kubectl config
if err := util.KubectlSetCluster(clusterID, result.apiEndpoint, result.caCertPath); err != nil {
return result, microerror.Mask(util.CouldNotSetKubectlClusterError)
}
if err := util.KubectlSetCredentials(clusterID, result.clientKeyPath, result.clientCertPath); err != nil {
return result, microerror.Mask(util.CouldNotSetKubectlCredentialsError)
}
if err := util.KubectlSetContext(result.contextName, clusterID); err != nil {
return result, microerror.Mask(util.CouldNotSetKubectlContextError)
}
if err := util.KubectlUseContext(result.contextName); err != nil {
return result, microerror.Mask(util.CouldNotUseKubectlContextError)
}
Expand Down

0 comments on commit 82bfcd4

Please sign in to comment.