Skip to content

Commit

Permalink
Use context timeout for joined check
Browse files Browse the repository at this point in the history
Signed-off-by: Kimmo Lehto <klehto@mirantis.com>
  • Loading branch information
kke committed Feb 12, 2025
1 parent f0f9092 commit e0279d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions phase/gather_k0s_facts.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func (p *GatherK0sFacts) listEtcdMembers(h *cluster.Host) error {
return nil
}

func (p *GatherK0sFacts) investigateK0s(_ context.Context, h *cluster.Host) error {
func (p *GatherK0sFacts) investigateK0s(ctx context.Context, h *cluster.Host) error {
output, err := h.ExecOutput(h.Configurer.K0sCmdf("version"), exec.Sudo(h))
if err != nil {
log.Debugf("%s: no 'k0s' binary in PATH", h)
Expand Down Expand Up @@ -314,7 +314,7 @@ func (p *GatherK0sFacts) investigateK0s(_ context.Context, h *cluster.Host) erro

if !h.IsController() {
log.Infof("%s: checking if worker %s has joined", p.leader, h.Metadata.Hostname)
if err := node.KubeNodeReadyFunc(h)(context.Background()); err != nil {
if err := node.KubeNodeReadyFunc(h)(ctx); err != nil {
log.Debugf("%s: failed to get ready status: %s", h, err.Error())
} else {
h.Metadata.Ready = true
Expand Down

0 comments on commit e0279d0

Please sign in to comment.