From d04e50ab547c744399bf1940ed5d22bbacd2f89d Mon Sep 17 00:00:00 2001 From: Darren Shepherd Date: Fri, 1 Mar 2019 17:10:18 -0700 Subject: [PATCH] Add agent command to server command --- pkg/cli/cmds/agent.go | 26 ++++++++++++++------------ pkg/cli/cmds/server.go | 2 ++ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/pkg/cli/cmds/agent.go b/pkg/cli/cmds/agent.go index dccdb52c34..9f7f8208f0 100644 --- a/pkg/cli/cmds/agent.go +++ b/pkg/cli/cmds/agent.go @@ -29,15 +29,25 @@ var ( AgentConfig Agent NodeIPFlag = cli.StringFlag{ Name: "node-ip,i", - Usage: "IP address to advertise for node", + Usage: "(agent) IP address to advertise for node", Destination: &AgentConfig.NodeIP, } NodeNameFlag = cli.StringFlag{ Name: "node-name", - Usage: "Node name", + Usage: "(agent) Node name", EnvVar: "K3S_NODE_NAME", Destination: &AgentConfig.NodeName, } + DockerFlag = cli.BoolFlag{ + Name: "docker", + Usage: "(agent) Use docker instead of containerd", + Destination: &AgentConfig.Docker, + } + FlannelFlag = cli.BoolFlag{ + Name: "no-flannel", + Usage: "(agent) Disable embedded flannel", + Destination: &AgentConfig.NoFlannel, + } ) func NewAgentCommand(action func(ctx *cli.Context) error) cli.Command { @@ -65,22 +75,14 @@ func NewAgentCommand(action func(ctx *cli.Context) error) cli.Command { Destination: &AgentConfig.DataDir, Value: "/var/lib/rancher/k3s", }, - cli.BoolFlag{ - Name: "docker", - Usage: "Use docker instead of containerd", - Destination: &AgentConfig.Docker, - }, - cli.BoolFlag{ - Name: "no-flannel", - Usage: "Disable embedded flannel", - Destination: &AgentConfig.NoFlannel, - }, cli.StringFlag{ Name: "cluster-secret", Usage: "Shared secret used to bootstrap a cluster", Destination: &AgentConfig.ClusterSecret, EnvVar: "K3S_CLUSTER_SECRET", }, + DockerFlag, + FlannelFlag, NodeNameFlag, NodeIPFlag, }, diff --git a/pkg/cli/cmds/server.go b/pkg/cli/cmds/server.go index cafc4bb3d3..bc0694369b 100644 --- a/pkg/cli/cmds/server.go +++ b/pkg/cli/cmds/server.go @@ -82,6 +82,8 @@ func NewServerCommand(action func(*cli.Context) error) cli.Command { }, NodeIPFlag, NodeNameFlag, + DockerFlag, + FlannelFlag, }, } }