From 2c63cab5414e218d1d833e204901344b8b67e345 Mon Sep 17 00:00:00 2001 From: Patrik Cyvoct Date: Fri, 3 Sep 2021 13:03:56 +0200 Subject: [PATCH] fix kubeconfig install command Signed-off-by: Patrik Cyvoct --- internal/namespaces/k8s/v1/custom_kubeconfig_install.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/internal/namespaces/k8s/v1/custom_kubeconfig_install.go b/internal/namespaces/k8s/v1/custom_kubeconfig_install.go index 10a64e97ba..a1e490efa0 100644 --- a/internal/namespaces/k8s/v1/custom_kubeconfig_install.go +++ b/internal/namespaces/k8s/v1/custom_kubeconfig_install.go @@ -156,16 +156,14 @@ func k8sKubeconfigInstallRun(ctx context.Context, argsI interface{}) (i interfac for _, user := range existingKubeconfig.AuthInfos { if user.Name == kubeconfig.AuthInfos[0].Name+"-"+request.ClusterID { userFoundInExistingKubeconfig = true - user.AuthInfo.Username = kubeconfig.AuthInfos[0].AuthInfo.Username + user.AuthInfo = kubeconfig.AuthInfos[0].AuthInfo break } } if !userFoundInExistingKubeconfig { existingKubeconfig.AuthInfos = append(existingKubeconfig.AuthInfos, api.NamedAuthInfo{ - Name: kubeconfig.AuthInfos[0].Name + "-" + request.ClusterID, - AuthInfo: api.AuthInfo{ - Username: kubeconfig.AuthInfos[0].AuthInfo.Username, - }, + Name: kubeconfig.AuthInfos[0].Name + "-" + request.ClusterID, + AuthInfo: kubeconfig.AuthInfos[0].AuthInfo, }) }