From 94d4ce5a6f8e5473f5551afa3519a305c2404684 Mon Sep 17 00:00:00 2001 From: Matthew Mosesohn Date: Mon, 28 Oct 2019 15:11:25 +0300 Subject: [PATCH] Retry cleaning up calico-node container (#5302) Change-Id: Iad27b107860213759c7ae51f0891d7e5e7c6d96b --- roles/network_plugin/calico/handlers/main.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/roles/network_plugin/calico/handlers/main.yml b/roles/network_plugin/calico/handlers/main.yml index 3cb4f9bcf..2c19347b2 100644 --- a/roles/network_plugin/calico/handlers/main.yml +++ b/roles/network_plugin/calico/handlers/main.yml @@ -13,10 +13,16 @@ - name: docker | delete calico-node containers shell: "docker ps -af name=k8s_POD_calico-node* -q | xargs --no-run-if-empty docker rm -f" + register: docker_calico_node_remove + until: docker_calico_node_remove is succeeded + retries: 5 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 %"' + register: crictl_calico_node_remove + until: crictl_calico_node_remove is succeeded + retries: 5 when: container_manager in ["crio", "containerd"] - name: Calico | Reload NetworkManager