mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-10-29 22:03:22 -02:30
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.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user