From 69ad777b45be7caaeaa50e4d8c239e324fd3c220 Mon Sep 17 00:00:00 2001 From: longxiucai Date: Mon, 12 Oct 2026 17:01:36 +0800 Subject: [PATCH] Fix reset rescue skipping pod cleanup when there are no network namespaces (#13632) With an empty 'ip netns list' (the common case), xargs without -r still runs 'ip netns delete' once with no argument. That fails, so the && chain short-circuits and 'crictl rmp -a -f' never runs: the rescue path leaves the pod sandboxes behind, which is exactly what it is there to clean up. Other tasks in the same file already use xargs -r. --- roles/reset/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/reset/tasks/main.yml b/roles/reset/tasks/main.yml index 33293204f..b67f1b105 100644 --- a/roles/reset/tasks/main.yml +++ b/roles/reset/tasks/main.yml @@ -131,7 +131,7 @@ rescue: - name: Reset | force remove all cri pods (rescue) - shell: "ip netns list | cut -d' ' -f 1 | xargs -n1 ip netns delete && {{ bin_dir }}/crictl rmp -a -f" + shell: "ip netns list | cut -d' ' -f 1 | xargs -r -n1 ip netns delete && {{ bin_dir }}/crictl rmp -a -f" ignore_errors: true # noqa ignore-errors changed_when: true