Skip to content

Commit

Permalink
[E2E] Handle 404 when deleting resources (#7885)
Browse files Browse the repository at this point in the history
  • Loading branch information
barkbay authored Jun 10, 2024
1 parent 1cc15ae commit 568efa3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/e2e/test/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ func deleteTestResources(ctx context.Context) error {
return fmt.Errorf("while listing all secrets in namespace %s: %w", namespace, err)
}
for _, secret := range list.Items {
if err := clntset.CoreV1().Secrets(namespace).Delete(ctx, secret.GetName(), v1.DeleteOptions{}); err != nil {
if err := clntset.CoreV1().Secrets(namespace).Delete(ctx, secret.GetName(), v1.DeleteOptions{}); err != nil && !api_errors.IsNotFound(err) {
return fmt.Errorf("while deleting secret %s in namespace %s: %w", secret.GetName(), namespace, err)
}
}
Expand All @@ -250,7 +250,7 @@ func deleteTestResources(ctx context.Context) error {
return fmt.Errorf("while listing all pods in namespace %s: %w", namespace, err)
}
for _, pod := range pods.Items {
if err := clntset.CoreV1().Pods(namespace).Delete(ctx, pod.GetName(), v1.DeleteOptions{}); err != nil {
if err := clntset.CoreV1().Pods(namespace).Delete(ctx, pod.GetName(), v1.DeleteOptions{}); err != nil && !api_errors.IsNotFound(err) {
return fmt.Errorf("while deleting pod %s in namespace %s: %w", pod.GetName(), namespace, err)
}
}
Expand Down

0 comments on commit 568efa3

Please sign in to comment.