Add Retry for Checking calico exists (#9883)

Signed-off-by: hang.jiang <hang.jiang@daocloud.io>
pull/9911/head
蒋航 2023-03-21 12:51:06 +08:00 committed by GitHub
parent 309aaee427
commit 83c3ce7f8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 4 deletions

View File

@ -50,10 +50,14 @@
run_once: True
delegate_to: "{{ groups['kube_control_plane'][0] }}"
- name: Check if calico ClusterInformation exists
command: "{{ bin_dir }}/calicoctl.sh get ClusterInformation"
register: clusterinformation_exists
- name: Check if calico ready
command: "{{ bin_dir }}/calicoctl.sh get ClusterInformation default"
register: calico_ready
run_once: True
ignore_errors: True
retries: 5
delay: 10
until: calico_ready.rc == 0
delegate_to: "{{ groups['kube_control_plane'][0] }}"
when: calicoctl_sh_exists.stat.exists
@ -76,7 +80,7 @@
But current version is {{ calico_version_on_server.stdout }}.
run_once: True
delegate_to: "{{ groups['kube_control_plane'][0] }}"
when: calicoctl_sh_exists.stat.exists and clusterinformation_exists.rc == 0
when: calicoctl_sh_exists.stat.exists and calico_ready.rc == 0
- name: "Check that cluster_id is set if calico_rr enabled"
assert: