Skip to content

Commit

Permalink
Fix calico handler for containerd (kubernetes-sigs#4985)
Browse files Browse the repository at this point in the history
crictl tool must be used to delete containers in case of containerd
deployment
  • Loading branch information
skolekonov authored and k8s-ci-robot committed Jul 16, 2019
1 parent 70dc222 commit 428e52e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions roles/network_plugin/calico/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@
command: /bin/true
notify:
- delete 10-calico.conflist
- delete calico-node containers
- docker | delete calico-node containers
- containerd | delete calico-node containers

- name: delete 10-calico.conflist
file:
path: /etc/calico/10-calico.conflist
path: /etc/cni/net.d/10-calico.conflist
state: absent

- name: delete calico-node containers
- name: docker | delete calico-node containers
shell: "docker ps -af name=k8s_POD_calico-node* -q | xargs --no-run-if-empty docker rm -f"
when: container_manager in ["docker"]

- name: containerd | delete calico-node containers
shell: 'crictl pods --name calico-node-* -q | xargs -I% --no-run-if-empty bash -c "crictl stopp % && crictl rmp %"'
when: container_manager in ["crio", "containerd"]

0 comments on commit 428e52e

Please sign in to comment.