engine, integration, setup: Seeds should be called properly

This commit is contained in:
James Shubin
2025-06-07 17:51:45 -04:00
parent 25263fe9ea
commit 2b7e9c3200
3 changed files with 12 additions and 7 deletions

View File

@@ -574,8 +574,14 @@ func (obj *VirtBuilderRes) CheckApply(ctx context.Context, apply bool) (bool, er
"--enable", // start on first boot! "--enable", // start on first boot!
fmt.Sprintf("--binary-path=%s", m), fmt.Sprintf("--binary-path=%s", m),
"--no-server", // TODO: hardcode this for now "--no-server", // TODO: hardcode this for now
fmt.Sprintf("--seeds=%s", strings.Join(obj.Seeds, ",")), //fmt.Sprintf("--seeds=%s", strings.Join(obj.Seeds, ",")),
} }
for _, seed := range obj.Seeds {
// TODO: validate each seed?
s := fmt.Sprintf("--seeds=%s", seed)
setupSvc = append(setupSvc, s)
}
setupSvcCmd := strings.Join(setupSvc, " ") setupSvcCmd := strings.Join(setupSvc, " ")
args := []string{"--run-command", setupSvcCmd} // cmd must be a single string args := []string{"--run-command", setupSvcCmd} // cmd must be a single string
cmdArgs = append(cmdArgs, args...) cmdArgs = append(cmdArgs, args...)

View File

@@ -261,12 +261,11 @@ func (obj *Instance) Run(seeds []*Instance) error {
return fmt.Errorf("instance `%s` has not started yet", instance.Hostname) return fmt.Errorf("instance `%s` has not started yet", instance.Hostname)
} }
urls = append(urls, instance.clientURL) urls = append(urls, instance.clientURL)
}
s := fmt.Sprintf("--seeds=%s", urls[0]) s := fmt.Sprintf("--seeds=%s", instance.clientURL)
// TODO: we could just add all the seeds instead...
//s := fmt.Sprintf("--seeds=%s", strings.Join(urls, ","))
cmdArgs = append(cmdArgs, s) cmdArgs = append(cmdArgs, s)
} }
}
if obj.EtcdServer { if obj.EtcdServer {
cmdArgs = append(cmdArgs, "--no-server") cmdArgs = append(cmdArgs, "--no-server")
cmdArgs = append(cmdArgs, "--ideal-cluster-size=1") cmdArgs = append(cmdArgs, "--ideal-cluster-size=1")

View File

@@ -115,9 +115,9 @@ func (obj *Svc) Run(ctx context.Context) error {
argv = append(argv, fmt.Sprintf("--ssh-url=%s", s)) argv = append(argv, fmt.Sprintf("--ssh-url=%s", s))
} }
if seeds := obj.SetupSvcArgs.Seeds; len(seeds) > 0 { for _, seed := range obj.SetupSvcArgs.Seeds {
// TODO: validate each seed? // TODO: validate each seed?
s := fmt.Sprintf("--seeds=%s", strings.Join(seeds, ",")) s := fmt.Sprintf("--seeds=%s", seed)
argv = append(argv, s) argv = append(argv, s)
} }