diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index 7691502f45..a3afc7451c 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -911,6 +911,10 @@ func validateFlags(cmd *cobra.Command, drvName string) { } } + if s := viper.GetString(startOutput); s != "text" && s != "json" { + exit.UsageT("Sorry, please set the --output flag to one of the following valid options: [text,json]") + } + validateRegistryMirror() } diff --git a/cmd/minikube/cmd/start_flags.go b/cmd/minikube/cmd/start_flags.go index 91dc5f6d96..698b7d307c 100644 --- a/cmd/minikube/cmd/start_flags.go +++ b/cmd/minikube/cmd/start_flags.go @@ -145,7 +145,7 @@ func initMinikubeFlags() { startCmd.Flags().Bool(preload, true, "If set, download tarball of preloaded images if available to improve start time. Defaults to true.") startCmd.Flags().Bool(deleteOnFailure, false, "If set, delete the current cluster if start fails and try again. Defaults to false.") startCmd.Flags().Bool(forceSystemd, false, "If set, force the container runtime to use sytemd as cgroup manager. Currently available for docker and crio. Defaults to false.") - startCmd.Flags().String(startOutput, "", "Format to print stdout in. Options include: [json]") + startCmd.Flags().String(startOutput, "text", "Format to print stdout in. Options include: [text,json]") } // initKubernetesFlags inits the commandline flags for Kubernetes related options