Fix reset when using containerd (#7308)

Signed-off-by: Etienne Champetier <e.champetier@ateme.com>
(cherry picked from commit ed2b4b805e)
This commit is contained in:
Etienne Champetier 2021-02-22 15:44:03 -05:00 committed by Kubernetes Prow Robot
parent daea9f3d21
commit 557139a8cf

View file

@ -129,7 +129,8 @@
- container_manager == "containerd"
ignore_errors: true
- name: reset | force remove all cri pods
- block:
- name: reset | force remove all cri pods
command: "{{ bin_dir }}/crictl rmp -a -f"
register: remove_all_cri_containers
retries: 5
@ -140,6 +141,10 @@
- crictl.stat.exists
- container_manager == "containerd"
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"
- name: reset | stop etcd services
service:
name: "{{ item }}"