fix: bootstrap etcd after Talos API is ready
This commit is contained in:
parent
9816bc45bc
commit
dc8b49d576
|
|
@ -508,8 +508,7 @@ func bootstrapEtcdIfNeeded(dir string, cfg config.Config) error {
|
|||
func waitForTalosReboot(dir string, cfg config.Config, node string) error {
|
||||
deadline := time.Now().Add(5 * time.Minute)
|
||||
for time.Now().Before(deadline) {
|
||||
output, err := utils.RunCommandQuietOutputInDir(dir, "talosctl", "get", "machinestatus", "--output=json", "--talosconfig=./clusterconfig/talosconfig", "--endpoints="+node, "--nodes="+node)
|
||||
if err == nil && strings.Contains(string(output), `"stage": "running"`) {
|
||||
if _, err := utils.RunCommandQuietOutputInDir(dir, "talosctl", "get", "machinestatus", "--output=json", "--talosconfig=./clusterconfig/talosconfig", "--endpoints="+node, "--nodes="+node); err == nil {
|
||||
return nil
|
||||
}
|
||||
time.Sleep(2 * time.Second)
|
||||
|
|
|
|||
Loading…
Reference in a new issue