Skip to content

Commit

Permalink
fix: ignore forbidden error when waiting for pod eviction
Browse files Browse the repository at this point in the history
K8s 1.32+ won't lest us get deleted pods as it doesn't belong to our
node, so just assume the pod is gone (at least it's not on our node
anymore).

Fixes #10154

Signed-off-by: Andrey Smirnov <[email protected]>
  • Loading branch information
smira committed Jan 17, 2025
1 parent 8dea57a commit 399d53b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,9 @@ func (h *Client) waitForPodDeleted(ctx context.Context, p *corev1.Pod) error {
switch {
case apierrors.IsNotFound(err):
return nil
case apierrors.IsForbidden(err):
// in Kubernetes 1.32+, NodeRestriction plugin won't let us list a pod which is not on our node, including deleted ones
return nil
case err != nil:
if IsRetryableError(err) {
return retry.ExpectedError(err)
Expand Down

0 comments on commit 399d53b

Please sign in to comment.