mirror of https://github.com/k3s-io/k3s
Merge pull request #1693 from ibuildthecloud/disableditem
Move disabled items to a const to keep more consistencypull/1752/head
commit
21eabd902b
|
@ -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",
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue