Skip to content

Commit

Permalink
Merge pull request #6536 from tstromberg/wait-nada2
Browse files Browse the repository at this point in the history
Add --install-addons toggle for users who don't want them
  • Loading branch information
priyawadhwa authored Feb 7, 2020
2 parents 666bde9 + caf4c62 commit 914e7de
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
12 changes: 8 additions & 4 deletions cmd/minikube/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ const (
kvmHidden = "kvm-hidden"
minikubeEnvPrefix = "MINIKUBE"
defaultMemorySize = "2000mb"
installAddons = "install-addons"
defaultDiskSize = "20000mb"
keepContext = "keep-context"
createMount = "mount"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.")
Expand Down
2 changes: 1 addition & 1 deletion test/integration/docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion test/integration/guest_env_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 914e7de

Please sign in to comment.