Browse Source

calico: use absolute path to docker, crictl binary (#6253)

To avoid the following error (ignored when pipefail is off)

  RUNNING HANDLER [network_plugin/calico : containerd | delete calico-node containers] *******************************************************************************
  changed: [node1] => {"attempts": 1, "changed": true, "cmd": "crictl pods --name calico-node-* -q | xargs -I% --no-run-if-empty bash -c \"crictl stopp % && crictl rmp %\"", "delta": "0:00:00.004240", "end": "2020-06-10 03:32:41.316955", "rc": 0, "start": "2020-06-10 03:32:41.312715", "stderr": "/bin/sh: crictl: command not found", "stderr_lines": ["/bin/sh: crictl: command not found"], "stdout": "", "stdout_lines": []}
pull/6258/head
Yousong Zhou 4 years ago
committed by GitHub
parent
commit
a7b8708dfc
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions
  1. 4
      roles/network_plugin/calico/handlers/main.yml

4
roles/network_plugin/calico/handlers/main.yml

@ -12,14 +12,14 @@
state: absent state: absent
- name: docker | 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"
shell: "{{ docker_bin_dir }}/docker ps -af name=k8s_POD_calico-node* -q | xargs --no-run-if-empty {{ docker_bin_dir }}/docker rm -f"
register: docker_calico_node_remove register: docker_calico_node_remove
until: docker_calico_node_remove is succeeded until: docker_calico_node_remove is succeeded
retries: 5 retries: 5
when: container_manager in ["docker"] when: container_manager in ["docker"]
- name: containerd | delete calico-node containers - 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 %"'
shell: '{{ bin_dir }}/crictl pods --name calico-node-* -q | xargs -I% --no-run-if-empty bash -c "{{ bin_dir }}/crictl stopp % && {{ bin_dir }}/crictl rmp %"'
register: crictl_calico_node_remove register: crictl_calico_node_remove
until: crictl_calico_node_remove is succeeded until: crictl_calico_node_remove is succeeded
retries: 5 retries: 5

Loading…
Cancel
Save