Skip to content

Commit

Permalink
Merge pull request #6124 from priyawadhwa/addon-per-profile-refactor
Browse files Browse the repository at this point in the history
Enable or disable addons per profile
  • Loading branch information
tstromberg authored Jan 7, 2020
2 parents 06b1cf3 + 6ad7e4a commit af4ee5c
Show file tree
Hide file tree
Showing 21 changed files with 621 additions and 454 deletions.
119 changes: 2 additions & 117 deletions cmd/minikube/cmd/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,123 +142,8 @@ var settings = []Setting{
set: SetBool,
},
{
name: "dashboard",
set: SetBool,
validations: []setFn{IsValidAddon},
callbacks: []setFn{EnableOrDisableAddon},
},
{
name: "istio-provisioner",
set: SetBool,
validations: []setFn{IsValidAddon},
callbacks: []setFn{EnableOrDisableAddon},
},
{
name: "istio",
set: SetBool,
validations: []setFn{IsValidAddon},
callbacks: []setFn{EnableOrDisableAddon},
},
{
name: "addon-manager",
set: SetBool,
validations: []setFn{IsValidAddon},
callbacks: []setFn{EnableOrDisableAddon},
},
{
name: "default-storageclass",
set: SetBool,
validations: []setFn{IsValidAddon},
callbacks: []setFn{EnableOrDisableStorageClasses},
},
{
name: "efk",
set: SetBool,
validations: []setFn{IsValidAddon},
callbacks: []setFn{EnableOrDisableAddon},
},
{
name: "ingress",
set: SetBool,
validations: []setFn{IsValidAddon},
callbacks: []setFn{EnableOrDisableAddon},
},
{
name: "insecure-registry",
set: SetBool,
validations: []setFn{IsValidAddon},
callbacks: []setFn{EnableOrDisableAddon},
},
{
name: "registry",
set: SetBool,
validations: []setFn{IsValidAddon},
callbacks: []setFn{EnableOrDisableAddon},
},
{
name: "registry-creds",
set: SetBool,
validations: []setFn{IsValidAddon},
callbacks: []setFn{EnableOrDisableAddon},
},
{
name: "freshpod",
set: SetBool,
validations: []setFn{IsValidAddon},
callbacks: []setFn{EnableOrDisableAddon},
},
{
name: "storage-provisioner",
set: SetBool,
validations: []setFn{IsValidAddon},
callbacks: []setFn{EnableOrDisableAddon},
},
{
name: "storage-provisioner-gluster",
set: SetBool,
validations: []setFn{IsValidAddon},
callbacks: []setFn{EnableOrDisableStorageClasses},
},
{
name: "metrics-server",
set: SetBool,
validations: []setFn{IsValidAddon},
callbacks: []setFn{EnableOrDisableAddon},
},
{
name: "nvidia-driver-installer",
set: SetBool,
validations: []setFn{IsValidAddon},
callbacks: []setFn{EnableOrDisableAddon},
},
{
name: "nvidia-gpu-device-plugin",
set: SetBool,
validations: []setFn{IsValidAddon},
callbacks: []setFn{EnableOrDisableAddon},
},
{
name: "logviewer",
set: SetBool,
validations: []setFn{IsValidAddon},
},
{
name: "gvisor",
set: SetBool,
validations: []setFn{IsValidAddon, IsContainerdRuntime},
callbacks: []setFn{EnableOrDisableAddon},
},
{
name: "helm-tiller",
set: SetBool,
validations: []setFn{IsValidAddon},
callbacks: []setFn{EnableOrDisableAddon},
},
{
name: "ingress-dns",
set: SetBool,
validations: []setFn{IsValidAddon},
callbacks: []setFn{EnableOrDisableAddon},
name: "insecure-registry",
set: SetString,
},
{
name: "hyperv-virtual-switch",
Expand Down
5 changes: 4 additions & 1 deletion cmd/minikube/cmd/config/disable.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ package config

import (
"github.com/spf13/cobra"
"github.com/spf13/viper"
"k8s.io/minikube/pkg/addons"
"k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/exit"
"k8s.io/minikube/pkg/minikube/out"
)
Expand All @@ -32,7 +35,7 @@ var addonsDisableCmd = &cobra.Command{
}

addon := args[0]
err := Set(addon, "false")
err := addons.Set(addon, "false", viper.GetString(config.MachineProfile))
if err != nil {
exit.WithError("disable failed", err)
}
Expand Down
39 changes: 0 additions & 39 deletions cmd/minikube/cmd/config/disable_test.go

This file was deleted.

5 changes: 4 additions & 1 deletion cmd/minikube/cmd/config/enable.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ package config

import (
"github.com/spf13/cobra"
"github.com/spf13/viper"
"k8s.io/minikube/pkg/addons"
"k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/exit"
"k8s.io/minikube/pkg/minikube/out"
)
Expand All @@ -32,7 +35,7 @@ var addonsEnableCmd = &cobra.Command{
}

addon := args[0]
err := Set(addon, "true")
err := addons.Set(addon, "true", viper.GetString(config.MachineProfile))
if err != nil {
exit.WithError("enable failed", err)
}
Expand Down
39 changes: 0 additions & 39 deletions cmd/minikube/cmd/config/enable_test.go

This file was deleted.

Loading

0 comments on commit af4ee5c

Please sign in to comment.