move provideclusterinfo assignment into correct place

This commit is contained in:
Arda Güçlü 2023-11-28 08:54:54 +03:00
parent b088e65007
commit 5e5f8b1dd2

View File

@ -302,8 +302,6 @@ func (o *setCredentialsOptions) modifyAuthInfo(existingAuthInfo clientcmdapi.Aut
// explicitly reset exec arguments // explicitly reset exec arguments
modifiedAuthInfo.Exec.Args = nil modifiedAuthInfo.Exec.Args = nil
} }
modifiedAuthInfo.Exec.ProvideClusterInfo = o.execProvideClusterInfo
} }
// modify next values only if Exec exists, ignore these changes otherwise // modify next values only if Exec exists, ignore these changes otherwise
@ -321,6 +319,8 @@ func (o *setCredentialsOptions) modifyAuthInfo(existingAuthInfo clientcmdapi.Aut
modifiedAuthInfo.Exec.InteractiveMode = clientcmdapi.ExecInteractiveMode(o.execInteractiveMode.Value()) modifiedAuthInfo.Exec.InteractiveMode = clientcmdapi.ExecInteractiveMode(o.execInteractiveMode.Value())
} }
modifiedAuthInfo.Exec.ProvideClusterInfo = o.execProvideClusterInfo
// iterate over the existing exec env values and remove the specified // iterate over the existing exec env values and remove the specified
if o.execEnvToRemove != nil { if o.execEnvToRemove != nil {
newExecEnv := []clientcmdapi.ExecEnvVar{} newExecEnv := []clientcmdapi.ExecEnvVar{}