Skip to content

Commit

Permalink
Fix reset when using containerd (kubernetes-sigs#7308)
Browse files Browse the repository at this point in the history
Signed-off-by: Etienne Champetier <[email protected]>
  • Loading branch information
champtar authored and stress-t committed Feb 25, 2021
1 parent dd945dc commit b1d601a
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions roles/reset/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,21 @@
- container_manager == "containerd"
ignore_errors: true

- name: reset | force remove all cri pods
command: "{{ bin_dir }}/crictl rmp -a -f"
register: remove_all_cri_containers
retries: 5
until: remove_all_cri_containers.rc == 0
delay: 5
tags: [ containerd ]
when:
- crictl.stat.exists
- container_manager == "containerd"
- block:
- name: reset | force remove all cri pods
command: "{{ bin_dir }}/crictl rmp -a -f"
register: remove_all_cri_containers
retries: 5
until: remove_all_cri_containers.rc == 0
delay: 5
tags: [ containerd ]
when:
- 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:
Expand Down

0 comments on commit b1d601a

Please sign in to comment.