setup: Add the ssh url arg to the setup utility
This commit is contained in:
@@ -164,6 +164,7 @@ type SetupPkgArgs struct {
|
|||||||
// parsed result.
|
// parsed result.
|
||||||
type SetupSvcArgs struct {
|
type SetupSvcArgs struct {
|
||||||
BinaryPath string `arg:"--binary-path" help:"path to the binary"`
|
BinaryPath string `arg:"--binary-path" help:"path to the binary"`
|
||||||
|
SSHURL string `arg:"--ssh-url" help:"transport the etcd client connection over SSH to this server"`
|
||||||
Seeds []string `arg:"--seeds,env:MGMT_SEEDS" help:"default etcd client endpoints"`
|
Seeds []string `arg:"--seeds,env:MGMT_SEEDS" help:"default etcd client endpoints"`
|
||||||
NoServer bool `arg:"--no-server" help:"do not start embedded etcd server (do not promote from client to peer)"`
|
NoServer bool `arg:"--no-server" help:"do not start embedded etcd server (do not promote from client to peer)"`
|
||||||
|
|
||||||
|
|||||||
@@ -110,6 +110,11 @@ func (obj *Svc) Run(ctx context.Context) error {
|
|||||||
"run", // run command
|
"run", // run command
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if s := obj.SetupSvcArgs.SSHURL; s != "" {
|
||||||
|
// TODO: validate ssh url? Should be user@server:port
|
||||||
|
argv = append(argv, fmt.Sprintf("--ssh-url=%s", s))
|
||||||
|
}
|
||||||
|
|
||||||
if seeds := obj.SetupSvcArgs.Seeds; len(seeds) > 0 {
|
if seeds := obj.SetupSvcArgs.Seeds; len(seeds) > 0 {
|
||||||
// TODO: validate each seed?
|
// TODO: validate each seed?
|
||||||
s := fmt.Sprintf("--seeds=%s", strings.Join(seeds, ","))
|
s := fmt.Sprintf("--seeds=%s", strings.Join(seeds, ","))
|
||||||
|
|||||||
Reference in New Issue
Block a user