Skip to content

Commit

Permalink
fix: ignore not existing nodes on cordoning
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
smira committed Nov 18, 2021
1 parent f730252 commit c6a67b8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit c6a67b8

Please sign in to comment.