fix: ignore not existing nodes on cordoning

Fixes #4557

When running `reset` for a node which was already deleted from
Kubernetes, we should ignore failure to cordon and proceed with other
actions.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
This commit is contained in:
Andrey Smirnov 2021-11-18 18:39:01 +03:00
parent f730252579
commit c6a67b8662
No known key found for this signature in database
GPG Key ID: 7B26396447AB6DFD

View File

@ -348,6 +348,11 @@ func (h *Client) Cordon(ctx context.Context, name string) error {
return retry.ExpectedError(err)
}
if apierrors.IsNotFound(err) {
// node not found, should have already been deleted, skip cordoning
return nil
}
return err
}