Skip to content

Commit

Permalink
Fix Get current calico version
Browse files Browse the repository at this point in the history
Signed-off-by: hang.jiang <hang.jiang@daocloud.io>
  • Loading branch information
hang.jiang committed Mar 10, 2023
1 parent fff4005 commit e55d1a4
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions roles/network_plugin/calico/tasks/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,16 @@
run_once: True
delegate_to: "{{ groups['kube_control_plane'][0] }}"

- name: Check if calico exists
- name: Check if calicoctl.sh exists
stat:
path: "{{ bin_dir }}/calicoctl.sh"
register: calico_exists
register: calicoctl_sh_exists
run_once: True
delegate_to: "{{ groups['kube_control_plane'][0] }}"

- name: Check if calico crd clusterinformations exists
command: "{{ bin_dir }}/kubectl get crds clusterinformations.crd.projectcalico.org"
register: clusterinformations_crd_exists
run_once: True
delegate_to: "{{ groups['kube_control_plane'][0] }}"

Expand All @@ -69,7 +75,7 @@
But current version is {{ calico_version_on_server.stdout }}.
run_once: True
delegate_to: "{{ groups['kube_control_plane'][0] }}"
when: calico_exists.stat.exists
when: calicoctl_sh_exists.stat.exists and clusterinformations_crd_exists.rc == 0

- name: "Check that cluster_id is set if calico_rr enabled"
assert:
Expand Down

0 comments on commit e55d1a4

Please sign in to comment.