1
0
mirror of https://github.com/rancher/rke.git synced 2025-08-10 19:22:41 +00:00

Added flag to ignore docker version

This commit is contained in:
Bill Maxwell 2018-05-15 10:35:52 -07:00 committed by Alena Prokharchyk
parent db3bda1191
commit 73e56b0fbb
4 changed files with 16 additions and 4 deletions

View File

@ -10,11 +10,15 @@ import (
"github.com/urfave/cli" "github.com/urfave/cli"
) )
var sshCliOptions = []cli.Flag{ var commonFlags = []cli.Flag{
cli.BoolFlag{ cli.BoolFlag{
Name: "ssh-agent-auth", Name: "ssh-agent-auth",
Usage: "Use SSH Agent Auth defined by SSH_AUTH_SOCK", Usage: "Use SSH Agent Auth defined by SSH_AUTH_SOCK",
}, },
cli.BoolFlag{
Name: "ignore-docker-version",
Usage: "Disable Docker version check",
},
} }
func resolveClusterFile(ctx *cli.Context) (string, string, error) { func resolveClusterFile(ctx *cli.Context) (string, string, error) {
@ -41,5 +45,10 @@ func setOptionsFromCLI(c *cli.Context, rkeConfig *v3.RancherKubernetesEngineConf
if c.Bool("ssh-agent-auth") { if c.Bool("ssh-agent-auth") {
rkeConfig.SSHAgentAuth = c.Bool("ssh-agent-auth") rkeConfig.SSHAgentAuth = c.Bool("ssh-agent-auth")
} }
if c.Bool("ignore-docker-version") {
rkeConfig.IgnoreDockerVersion = c.Bool("ignore-docker-version")
}
return rkeConfig, nil return rkeConfig, nil
} }

View File

@ -26,7 +26,7 @@ func EtcdCommand() cli.Command {
}, },
} }
backupRestoreFlags = append(backupRestoreFlags, sshCliOptions...) backupRestoreFlags = append(backupRestoreFlags, commonFlags...)
return cli.Command{ return cli.Command{
Name: "etcd", Name: "etcd",

View File

@ -35,7 +35,7 @@ func RemoveCommand() cli.Command {
}, },
} }
removeFlags = append(removeFlags, sshCliOptions...) removeFlags = append(removeFlags, commonFlags...)
return cli.Command{ return cli.Command{
Name: "remove", Name: "remove",

View File

@ -39,7 +39,7 @@ func UpCommand() cli.Command {
}, },
} }
upFlags = append(upFlags, sshCliOptions...) upFlags = append(upFlags, commonFlags...)
return cli.Command{ return cli.Command{
Name: "up", Name: "up",
@ -199,6 +199,9 @@ func clusterUpLocal(ctx *cli.Context) error {
} }
rkeConfig.Nodes = []v3.RKEConfigNode{*cluster.GetLocalRKENodeConfig()} rkeConfig.Nodes = []v3.RKEConfigNode{*cluster.GetLocalRKENodeConfig()}
} }
rkeConfig.IgnoreDockerVersion = ctx.Bool("ignore-docker-version")
_, _, _, _, _, err = ClusterUp(context.Background(), rkeConfig, nil, hosts.LocalHealthcheckFactory, nil, true, "", false, false) _, _, _, _, _, err = ClusterUp(context.Background(), rkeConfig, nil, hosts.LocalHealthcheckFactory, nil, true, "", false, false)
return err return err
} }