Skip to content

Commit

Permalink
fix condition check for extraOpts validation
Browse files Browse the repository at this point in the history
  • Loading branch information
nezorflame committed Jun 28, 2020
1 parent ccffa40 commit b470860
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/minikube/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}}",
Expand Down
2 changes: 1 addition & 1 deletion pkg/minikube/bootstrapper/bsutil/extraconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit b470860

Please sign in to comment.