From b85751e07ea5db6e442edb544e5bb63972b94725 Mon Sep 17 00:00:00 2001 From: James Shubin Date: Mon, 26 May 2025 02:26:32 -0400 Subject: [PATCH] setup: Add the ssh url arg to the setup utility --- cli/util/args.go | 1 + setup/svc.go | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/cli/util/args.go b/cli/util/args.go index 6c9375d6..1cc1d131 100644 --- a/cli/util/args.go +++ b/cli/util/args.go @@ -164,6 +164,7 @@ type SetupPkgArgs struct { // parsed result. type SetupSvcArgs struct { 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"` NoServer bool `arg:"--no-server" help:"do not start embedded etcd server (do not promote from client to peer)"` diff --git a/setup/svc.go b/setup/svc.go index b33ce9e7..472e41bd 100644 --- a/setup/svc.go +++ b/setup/svc.go @@ -110,6 +110,11 @@ func (obj *Svc) Run(ctx context.Context) error { "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 { // TODO: validate each seed? s := fmt.Sprintf("--seeds=%s", strings.Join(seeds, ","))