setup: Add the ssh url arg to the setup utility

This commit is contained in:
James Shubin
2025-05-26 02:26:32 -04:00
parent 0fd6970c0a
commit b85751e07e
2 changed files with 6 additions and 0 deletions

View File

@@ -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)"`

View File

@@ -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, ","))