From d42a041ac71080ca413f73ec7248e060ab329ded Mon Sep 17 00:00:00 2001 From: Kimmo Lehto Date: Mon, 28 Aug 2023 14:04:23 +0300 Subject: [PATCH] There is no --since-time Signed-off-by: Kimmo Lehto --- pkg/node/wait.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/node/wait.go b/pkg/node/wait.go index d6870fbe..d2cf5ca0 100644 --- a/pkg/node/wait.go +++ b/pkg/node/wait.go @@ -108,10 +108,9 @@ func WaitK0sDynamicConfigReady(ctx context.Context, h *cluster.Host) error { // WaitEventsScheduled blocks until the node has started scheduling pods or context is cancelled func WaitEventsScheduled(ctx context.Context, h *cluster.Host) error { since := time.Now() - sinceStr := since.Format(time.RFC3339) return retry(ctx, func(_ context.Context) error { - output, err := h.ExecOutput(h.Configurer.KubectlCmdf(h, h.K0sDataDir(), `-n kube-system get events --field-selector reason=Scheduled --since-time="%s"`, sinceStr), exec.Sudo(h)) + output, err := h.ExecOutput(h.Configurer.KubectlCmdf(h, h.K0sDataDir(), "-n kube-system get events --field-selector reason=Scheduled"), exec.Sudo(h)) if err != nil { return fmt.Errorf("failed to get node events: %w", err) } @@ -127,9 +126,10 @@ func WaitEventsScheduled(ctx context.Context, h *cluster.Host) error { continue } if e.EventTime.Before(since) { - log.Debugf("%s: skipping event %s at %s - too old", h, e.Reason, e.EventTime) + log.Debugf("%s: skipping event: %s is too old", h, e.EventTime) continue } + log.Debugf("%s: found a 'Scheduled' event occuring after api start-up", h) return nil } return fmt.Errorf("node not scheduled")