diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index 5c7a21c59f5b..5e633d1b2f73 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -92,6 +92,7 @@ const ( kvmHidden = "kvm-hidden" minikubeEnvPrefix = "MINIKUBE" defaultMemorySize = "2000mb" + installAddons = "install-addons" defaultDiskSize = "20000mb" keepContext = "keep-context" createMount = "mount" @@ -179,6 +180,7 @@ func initMinikubeFlags() { startCmd.Flags().Duration(waitTimeout, 6*time.Minute, "max time to wait per Kubernetes core services to be healthy.") startCmd.Flags().Bool(nativeSSH, true, "Use native Golang SSH client (default true). Set to 'false' to use the command line 'ssh' command when accessing the docker machine. Useful for the machine drivers when they will not start with 'Waiting for SSH'.") startCmd.Flags().Bool(autoUpdate, true, "If set, automatically updates drivers to the latest version. Defaults to true.") + startCmd.Flags().Bool(installAddons, true, "If set, install addons. Defaults to true.") } // initKubernetesFlags inits the commandline flags for kubernetes related options @@ -369,11 +371,13 @@ func runStart(cmd *cobra.Command, args []string) { configureMounts() // enable addons, both old and new! - existingAddons := map[string]bool{} - if existing != nil && existing.Addons != nil { - existingAddons = existing.Addons + if viper.GetBool(installAddons) { + existingAddons := map[string]bool{} + if existing != nil && existing.Addons != nil { + existingAddons = existing.Addons + } + addons.Start(viper.GetString(config.MachineProfile), existingAddons, addonList) } - addons.Start(viper.GetString(config.MachineProfile), existingAddons, addonList) if err = cacheAndLoadImagesInConfig(); err != nil { out.T(out.FailureType, "Unable to load cached images from config file.") diff --git a/test/integration/docker_test.go b/test/integration/docker_test.go index c04ba8617d54..e8c73df9c83c 100644 --- a/test/integration/docker_test.go +++ b/test/integration/docker_test.go @@ -37,7 +37,7 @@ func TestDockerFlags(t *testing.T) { defer CleanupWithLogs(t, profile, cancel) // Use the most verbose logging for the simplest test. If it fails, something is very wrong. - args := append([]string{"start", "-p", profile, "--cache-images=false", "--wait=false", "--docker-env=FOO=BAR", "--docker-env=BAZ=BAT", "--docker-opt=debug", "--docker-opt=icc=true", "--alsologtostderr", "-v=5"}, StartArgs()...) + args := append([]string{"start", "-p", profile, "--cache-images=false", "--install-addons=false", "--wait=false", "--docker-env=FOO=BAR", "--docker-env=BAZ=BAT", "--docker-opt=debug", "--docker-opt=icc=true", "--alsologtostderr", "-v=5"}, StartArgs()...) rr, err := Run(t, exec.CommandContext(ctx, Target(), args...)) if err != nil { t.Errorf("%s failed: %v", rr.Args, err) diff --git a/test/integration/guest_env_test.go b/test/integration/guest_env_test.go index 3182daf67a0e..29bf60ab5fce 100644 --- a/test/integration/guest_env_test.go +++ b/test/integration/guest_env_test.go @@ -33,7 +33,7 @@ func TestGuestEnvironment(t *testing.T) { ctx, cancel := context.WithTimeout(context.Background(), 15*time.Minute) defer CleanupWithLogs(t, profile, cancel) - args := append([]string{"start", "-p", profile, "--wait=false"}, StartArgs()...) + args := append([]string{"start", "-p", profile, "--install-addons=false", "--wait=false"}, StartArgs()...) rr, err := Run(t, exec.CommandContext(ctx, Target(), args...)) if err != nil { t.Errorf("%s failed: %v", rr.Args, err)