From f27329cedcdcb84efb7fa56798e13684c695d58f Mon Sep 17 00:00:00 2001 From: YZ775 Date: Fri, 19 Apr 2024 00:52:20 +0000 Subject: [PATCH] add cancel check in drainBackOff --- op/reboot.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/op/reboot.go b/op/reboot.go index 03817c8a..316c967b 100644 --- a/op/reboot.go +++ b/op/reboot.go @@ -568,6 +568,14 @@ func drainBackOff(ctx context.Context, inf cke.Infrastructure, entry *cke.Reboot "name": entry.Node, log.FnError: err, }) + + etcdEntry, err := inf.Storage().GetRebootsEntry(ctx, entry.Index) + if err != nil { + return err + } + if etcdEntry.Status == cke.RebootStatusCancelled { + return nil + } entry.Status = cke.RebootStatusQueued entry.LastTransitionTime = time.Now().Truncate(time.Second).UTC() entry.DrainBackOffCount++