From b470860a5a44c4a9bcace83c6159ef72d3a008e4 Mon Sep 17 00:00:00 2001 From: Ilya Danilkin Date: Mon, 25 May 2020 00:17:07 +0300 Subject: [PATCH] fix condition check for extraOpts validation --- cmd/minikube/cmd/start.go | 2 +- pkg/minikube/bootstrapper/bsutil/extraconfig.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index f2cdf882c2ed..9ed093816f8c 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -873,7 +873,7 @@ func validateFlags(cmd *cobra.Command, drvName string) { } // validate kubeadm extra args - if invalidOpts := bsutil.FindInvalidExtraConfigFlags(config.ExtraOptions); invalidOpts != nil { + if invalidOpts := bsutil.FindInvalidExtraConfigFlags(config.ExtraOptions); len(invalidOpts) > 0 { out.ErrT( out.Warning, "These --extra-config parameters are invalid: {{.invalid_extra_opts}}", diff --git a/pkg/minikube/bootstrapper/bsutil/extraconfig.go b/pkg/minikube/bootstrapper/bsutil/extraconfig.go index 825d22390a54..946d087836d2 100644 --- a/pkg/minikube/bootstrapper/bsutil/extraconfig.go +++ b/pkg/minikube/bootstrapper/bsutil/extraconfig.go @@ -148,7 +148,7 @@ func defaultOptionsForComponentAndVersion(component string, version semver.Versi // newComponentOptions creates a new componentOptions func newComponentOptions(opts config.ExtraOptionSlice, version semver.Version, featureGates string, cp config.Node) ([]componentOptions, error) { - if invalidOpts := FindInvalidExtraConfigFlags(opts); invalidOpts != nil { + if invalidOpts := FindInvalidExtraConfigFlags(opts); len(invalidOpts) > 0 { return nil, fmt.Errorf("unknown components %v. valid components are: %v", invalidOpts, KubeadmExtraConfigOpts) }