Skip to content

Commit a5438c4

Browse files
authored
fix kubeconfig install command (#1956)
Signed-off-by: Patrik Cyvoct <[email protected]>
1 parent f52876e commit a5438c4

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

internal/namespaces/k8s/v1/custom_kubeconfig_install.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,16 +156,14 @@ func k8sKubeconfigInstallRun(ctx context.Context, argsI interface{}) (i interfac
156156
for _, user := range existingKubeconfig.AuthInfos {
157157
if user.Name == kubeconfig.AuthInfos[0].Name+"-"+request.ClusterID {
158158
userFoundInExistingKubeconfig = true
159-
user.AuthInfo.Username = kubeconfig.AuthInfos[0].AuthInfo.Username
159+
user.AuthInfo = kubeconfig.AuthInfos[0].AuthInfo
160160
break
161161
}
162162
}
163163
if !userFoundInExistingKubeconfig {
164164
existingKubeconfig.AuthInfos = append(existingKubeconfig.AuthInfos, api.NamedAuthInfo{
165-
Name: kubeconfig.AuthInfos[0].Name + "-" + request.ClusterID,
166-
AuthInfo: api.AuthInfo{
167-
Username: kubeconfig.AuthInfos[0].AuthInfo.Username,
168-
},
165+
Name: kubeconfig.AuthInfos[0].Name + "-" + request.ClusterID,
166+
AuthInfo: kubeconfig.AuthInfos[0].AuthInfo,
169167
})
170168
}
171169

0 commit comments

Comments
 (0)