Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimze detecting if calico exists #9873

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions roles/network_plugin/calico/tasks/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,20 @@
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 ClusterInformation exists
command: "{{ bin_dir }}/calicoctl.sh get ClusterInformation"
register: clusterinformation_exists
run_once: True
delegate_to: "{{ groups['kube_control_plane'][0] }}"
when: calicoctl_sh_exists.stat.exists

- name: Check that current calico version is enough for upgrade
block:
- name: Get current calico version
Expand All @@ -69,7 +76,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 clusterinformation_exists.rc == 0

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