mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-08 03:33:56 +00:00
kubeadm: fix a bug in default apiserver "authorizaion-mode"
When the flag is defaulted before writing the apiserver manifest, the input "cfg" object should not be mutated. If the "cfg" is mutated, the upload ClusterConfiguration to the cluster will include the defaulting, which is not needed.
This commit is contained in:
parent
12217672a3
commit
5f7c36a4e9
@ -229,7 +229,7 @@ func getAPIServerCommand(cfg *kubeadmapi.ClusterConfiguration, localAPIEndpoint
|
||||
cfg.APIServer.ExtraArgs = []kubeadmapi.Arg{}
|
||||
}
|
||||
authzVal, _ := kubeadmapi.GetArgValue(cfg.APIServer.ExtraArgs, "authorization-mode", -1)
|
||||
cfg.APIServer.ExtraArgs = kubeadmapi.SetArgValues(cfg.APIServer.ExtraArgs, "authorization-mode", getAuthzModes(authzVal), 1)
|
||||
defaultArguments = kubeadmapi.SetArgValues(defaultArguments, "authorization-mode", getAuthzModes(authzVal), 1)
|
||||
command = append(command, kubeadmutil.ArgumentsToCommand(defaultArguments, cfg.APIServer.ExtraArgs)...)
|
||||
|
||||
return command
|
||||
|
Loading…
Reference in New Issue
Block a user