Skip to content

Commit

Permalink
operator should retry a few times before giving up getting the kiali …
Browse files Browse the repository at this point in the history
…version (#732)

fixes: kiali/kiali#6950
  • Loading branch information
jmazzitelli authored Dec 14, 2023
1 parent 57c494f commit 4eef7b4
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 10 deletions.
25 changes: 22 additions & 3 deletions roles/default/ossmconsole-deploy/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,31 @@
when:
- ossmconsole_vars.kiali.servicePort == 0

- name: Ask Kiali for information about itself
vars:
version_url: "{{ 'https://' + ossmconsole_vars.kiali.serviceName + '.' + ossmconsole_vars.kiali.serviceNamespace + '.svc.cluster.local:' + ossmconsole_vars.kiali.servicePort + '/api' }}"
uri:
url: "{{ version_url }}"
status_code: 200
validate_certs: false
return_content: true
register: kiali_info_results
until:
- kiali_info_results is defined
- kiali_info_results.status is defined
- kiali_info_results.status == 200
retries: 60
delay: 5
ignore_errors: yes

- name: Determine Kiali version
set_fact:
kiali_version: "{{ lookup('url', version_url, split_lines='no', validate_certs='no') | from_json | json_query(q) }}"
vars:
q: status."Kiali version"
version_url: "{{ 'https://' + ossmconsole_vars.kiali.serviceName + '.' + ossmconsole_vars.kiali.serviceNamespace + '.svc.cluster.local:' + ossmconsole_vars.kiali.servicePort + '/api' }}"
set_fact:
kiali_version: "{{ kiali_info_results.json | json_query(q) }}"
when:
- kiali_info_results is defined
- kiali_info_results.json is defined
ignore_errors: yes

- name: "Determine environment to store in status"
Expand Down
4 changes: 2 additions & 2 deletions roles/default/ossmconsole-deploy/tasks/process-resource.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# process all template names found in process_resource_templates - any empty strings in the list are ignored.
# This will keep a running tally of all processed resources in "processed_resources_dict".
- name: "Create Kiali resources from templates"
- name: "Create OSSMConsole resources from templates"
k8s:
state: "present"
continue_on_error: false
Expand Down Expand Up @@ -28,4 +28,4 @@

- name: "Resource creation results"
debug:
msg: "{{ processed_resources_dict }}"
msg: "{{ processed_resources_dict }}"
25 changes: 22 additions & 3 deletions roles/v1.73/ossmconsole-deploy/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,31 @@
when:
- ossmconsole_vars.kiali.servicePort == 0

- name: Ask Kiali for information about itself
vars:
version_url: "{{ 'https://' + ossmconsole_vars.kiali.serviceName + '.' + ossmconsole_vars.kiali.serviceNamespace + '.svc.cluster.local:' + ossmconsole_vars.kiali.servicePort + '/api' }}"
uri:
url: "{{ version_url }}"
status_code: 200
validate_certs: false
return_content: true
register: kiali_info_results
until:
- kiali_info_results is defined
- kiali_info_results.status is defined
- kiali_info_results.status == 200
retries: 60
delay: 5
ignore_errors: yes

- name: Determine Kiali version
set_fact:
kiali_version: "{{ lookup('url', version_url, split_lines='no', validate_certs='no') | from_json | json_query(q) }}"
vars:
q: status."Kiali version"
version_url: "{{ 'https://' + ossmconsole_vars.kiali.serviceName + '.' + ossmconsole_vars.kiali.serviceNamespace + '.svc.cluster.local:' + ossmconsole_vars.kiali.servicePort + '/api' }}"
set_fact:
kiali_version: "{{ kiali_info_results.json | json_query(q) }}"
when:
- kiali_info_results is defined
- kiali_info_results.json is defined
ignore_errors: yes

- name: "Determine environment to store in status"
Expand Down
4 changes: 2 additions & 2 deletions roles/v1.73/ossmconsole-deploy/tasks/process-resource.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# process all template names found in process_resource_templates - any empty strings in the list are ignored.
# This will keep a running tally of all processed resources in "processed_resources_dict".
- name: "Create Kiali resources from templates"
- name: "Create OSSMConsole resources from templates"
k8s:
state: "present"
continue_on_error: false
Expand Down Expand Up @@ -28,4 +28,4 @@

- name: "Resource creation results"
debug:
msg: "{{ processed_resources_dict }}"
msg: "{{ processed_resources_dict }}"

0 comments on commit 4eef7b4

Please sign in to comment.