Use 'Allowed' instead of 'Allow'
parent
09672520ea
commit
bd1bdb3696
|
@ -872,8 +872,8 @@ func validateFlags(cmd *cobra.Command, drvName string) {
|
|||
|
||||
// check that kubeadm extra args contain only allowed parameters
|
||||
for param := range config.ExtraOptions.AsMap().Get(bsutil.Kubeadm) {
|
||||
if !config.ContainsParam(bsutil.KubeadmExtraArgsAllow[bsutil.KubeadmCmdParam], param) &&
|
||||
!config.ContainsParam(bsutil.KubeadmExtraArgsAllow[bsutil.KubeadmConfigParam], param) {
|
||||
if !config.ContainsParam(bsutil.KubeadmExtraArgsAllowed[bsutil.KubeadmCmdParam], param) &&
|
||||
!config.ContainsParam(bsutil.KubeadmExtraArgsAllowed[bsutil.KubeadmConfigParam], param) {
|
||||
exit.UsageT("Sorry, the kubeadm.{{.parameter_name}} parameter is currently not supported by --extra-config", out.V{"parameter_name": param})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -150,7 +150,7 @@ func initKubernetesFlags() {
|
|||
`A set of key=value pairs that describe configuration that may be passed to different components.
|
||||
The key should be '.' separated, and the first part before the dot is the component to apply the configuration to.
|
||||
Valid components are: kubelet, kubeadm, apiserver, controller-manager, etcd, proxy, scheduler
|
||||
Valid kubeadm parameters: `+fmt.Sprintf("%s, %s", strings.Join(bsutil.KubeadmExtraArgsAllow[bsutil.KubeadmCmdParam], ", "), strings.Join(bsutil.KubeadmExtraArgsAllow[bsutil.KubeadmConfigParam], ",")))
|
||||
Valid kubeadm parameters: `+fmt.Sprintf("%s, %s", strings.Join(bsutil.KubeadmExtraArgsAllowed[bsutil.KubeadmCmdParam], ", "), strings.Join(bsutil.KubeadmExtraArgsAllowed[bsutil.KubeadmConfigParam], ",")))
|
||||
startCmd.Flags().String(featureGates, "", "A set of key=value pairs that describe feature gates for alpha/experimental features.")
|
||||
startCmd.Flags().String(dnsDomain, constants.ClusterDNSDomain, "The cluster dns domain name used in the Kubernetes cluster")
|
||||
startCmd.Flags().Int(apiServerPort, constants.APIServerPort, "The apiserver listening port")
|
||||
|
|
|
@ -29,7 +29,7 @@ import (
|
|||
)
|
||||
|
||||
// enum to differentiate kubeadm command line parameters from kubeadm config file parameters (see the
|
||||
// KubeadmExtraArgsAllow variable for more info)
|
||||
// KubeadmExtraArgsAllowed variable for more info)
|
||||
const (
|
||||
// KubeadmCmdParam is command parameters for kubeadm
|
||||
KubeadmCmdParam = iota
|
||||
|
@ -56,12 +56,12 @@ var componentToKubeadmConfigKey = map[string]string{
|
|||
Kubelet: "",
|
||||
}
|
||||
|
||||
// KubeadmExtraArgsAllow is a list of supported kubeadm params that can be supplied to kubeadm through
|
||||
// KubeadmExtraArgsAllowed is a list of supported kubeadm params that can be supplied to kubeadm through
|
||||
// minikube's ExtraArgs parameter. The list is split into two parts - params that can be supplied as flags on the
|
||||
// command line and params that have to be inserted into the kubeadm config file. This is because of a kubeadm
|
||||
// constraint which allows only certain params to be provided from the command line when the --config parameter
|
||||
// is specified
|
||||
var KubeadmExtraArgsAllow = map[int][]string{
|
||||
var KubeadmExtraArgsAllowed = map[int][]string{
|
||||
KubeadmCmdParam: {
|
||||
"ignore-preflight-errors",
|
||||
"dry-run",
|
||||
|
@ -86,7 +86,7 @@ func CreateFlagsFromExtraArgs(extraOptions config.ExtraOptionSlice) string {
|
|||
// kubeadm allows only a small set of parameters to be supplied from the command line when the --config param
|
||||
// is specified, here we remove those that are not allowed
|
||||
for opt := range kubeadmExtraOpts {
|
||||
if !config.ContainsParam(KubeadmExtraArgsAllow[KubeadmCmdParam], opt) {
|
||||
if !config.ContainsParam(KubeadmExtraArgsAllowed[KubeadmCmdParam], opt) {
|
||||
// kubeadmExtraOpts is a copy so safe to delete
|
||||
delete(kubeadmExtraOpts, opt)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue