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:
@@ -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
|
||||
|
Reference in New Issue
Block a user