Skip to content

Commit

Permalink
Improve node join timeout error message (#180)
Browse files Browse the repository at this point in the history
* Improve node join timeout error message

* Finetune
  • Loading branch information
kke committed Aug 5, 2021
1 parent 5b570a5 commit 9a52d76
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions config/cluster/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,13 +257,15 @@ func (h *Host) KubeNodeReady(node *Host) (bool, error) {
}
for _, i := range status.Items {
for _, c := range i.Status.Conditions {
log.Debugf("%s: node status condition %s = %s", node, c.Type, c.Status)
if c.Type == "Ready" {
return c.Status == "True", nil
}
}
}

return false, fmt.Errorf("failed to parse status from kubectl output")
log.Debugf("%s: failed to find Ready=True state in kubectl output", node)
return false, nil
}

// WaitKubeNodeReady blocks until node becomes ready. TODO should probably use Context
Expand All @@ -275,7 +277,7 @@ func (h *Host) WaitKubeNodeReady(node *Host) error {
return err
}
if !status {
return fmt.Errorf("%s: node %s did not become ready", h, node.Metadata.Hostname)
return fmt.Errorf("%s: node %s status not reported as ready", h, node.Metadata.Hostname)
}
return nil
},
Expand Down

0 comments on commit 9a52d76

Please sign in to comment.