Fix reset when using containerd (#7308)
Signed-off-by: Etienne Champetier <e.champetier@ateme.com>
This commit is contained in:
parent
8375aa72e2
commit
ed2b4b805e
1 changed files with 15 additions and 10 deletions
|
@ -132,16 +132,21 @@
|
||||||
- container_manager == "containerd"
|
- container_manager == "containerd"
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
- name: reset | force remove all cri pods
|
- block:
|
||||||
command: "{{ bin_dir }}/crictl rmp -a -f"
|
- name: reset | force remove all cri pods
|
||||||
register: remove_all_cri_containers
|
command: "{{ bin_dir }}/crictl rmp -a -f"
|
||||||
retries: 5
|
register: remove_all_cri_containers
|
||||||
until: remove_all_cri_containers.rc == 0
|
retries: 5
|
||||||
delay: 5
|
until: remove_all_cri_containers.rc == 0
|
||||||
tags: [ containerd ]
|
delay: 5
|
||||||
when:
|
tags: [ containerd ]
|
||||||
- crictl.stat.exists
|
when:
|
||||||
- container_manager == "containerd"
|
- 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
|
- name: reset | stop etcd services
|
||||||
service:
|
service:
|
||||||
|
|
Loading…
Reference in a new issue