Skip to content

Commit

Permalink
adjust grace delete webhook message
Browse files Browse the repository at this point in the history
  • Loading branch information
wu8685 authored and shaofan-hs committed Mar 28, 2024
1 parent d8f290b commit 1256a9a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/webhook/server/generic/pod/gracedelete/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,12 @@ func (gd *GraceDelete) Validating(ctx context.Context, c client.Client, oldPod,
finalizers = append(finalizers, f)
}
}
return fmt.Errorf("podOpsLifecycle denied delete request, since related resources and finalizers have not been processed. Waiting for removing finalizers: %v", finalizers)

if len(finalizers) == 0 {
return fmt.Errorf("this Pod's deletion process is underway and being managed by PodOpsLifecycle")
}

return fmt.Errorf("this Pod's deletion process is underway and being managed by PodOpsLifecycle with finalizers: %v", finalizers)
}

func (gd *GraceDelete) Mutating(ctx context.Context, c client.Client, oldPod, newPod *corev1.Pod, operation admissionv1.Operation) error {
Expand Down

0 comments on commit 1256a9a

Please sign in to comment.