Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --install-addons toggle for users who don't want them #6536

Merged
merged 2 commits into from
Feb 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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