diff --git a/pkg/cli/cmds/server.go b/pkg/cli/cmds/server.go index 2cda615cfb..acdea88bab 100644 --- a/pkg/cli/cmds/server.go +++ b/pkg/cli/cmds/server.go @@ -6,6 +6,10 @@ import ( "github.com/urfave/cli" ) +const ( + DisableItems = "coredns, servicelb, traefik, local-storage, metrics-server" +) + type Server struct { ClusterCIDR string AgentToken string @@ -194,7 +198,7 @@ func NewServerCommand(action func(*cli.Context) error) cli.Command { }, cli.StringSliceFlag{ Name: "disable", - Usage: "(components) Do not deploy packaged components and delete any deployed components (valid items: coredns, servicelb, traefik, local-storage, metrics-server)", + Usage: "(components) Do not deploy packaged components and delete any deployed components (valid items: " + DisableItems + ")", }, cli.BoolFlag{ Name: "disable-scheduler", @@ -275,7 +279,7 @@ func NewServerCommand(action func(*cli.Context) error) cli.Command { FlannelFlag, cli.StringSliceFlag{ Name: "no-deploy", - Usage: "(deprecated) Do not deploy packaged components (valid items: coredns, servicelb, traefik, local-storage, metrics-server)", + Usage: "(deprecated) Do not deploy packaged components (valid items: " + DisableItems + ")", }, cli.StringFlag{ Name: "cluster-secret", diff --git a/pkg/cli/server/server.go b/pkg/cli/server/server.go index 06afca8e11..d950ec3bf7 100644 --- a/pkg/cli/server/server.go +++ b/pkg/cli/server/server.go @@ -154,12 +154,14 @@ func run(app *cli.Context, cfg *cmds.Server) error { serverConfig.ControlConfig.Skips = map[string]bool{} for _, noDeploy := range app.StringSlice("no-deploy") { for _, v := range strings.Split(noDeploy, ",") { + v = strings.TrimSpace(v) serverConfig.ControlConfig.Skips[v] = true } } serverConfig.ControlConfig.Disables = map[string]bool{} for _, disable := range app.StringSlice("disable") { for _, v := range strings.Split(disable, ",") { + v = strings.TrimSpace(v) serverConfig.ControlConfig.Skips[v] = true serverConfig.ControlConfig.Disables[v] = true }