Skip to content

Commit

Permalink
console links
Browse files Browse the repository at this point in the history
  • Loading branch information
jmazzitelli committed Oct 25, 2023
1 parent 8e7a386 commit 5498910
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 0 deletions.
12 changes: 12 additions & 0 deletions roles/default/kiali-deploy/tasks/openshift/os-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@
when:
- is_openshift == True

# If it is Removed, the web console is disabled.
# See: https://docs.openshift.com/container-platform/4.13/web_console/disabling-web-console.html
- name: Determine if OpenShift Console is installed and enabled
vars:
console_res: "{{ query('kubernetes.core.k8s', resource_name='cluster', api_version='operator.openshift.io/v1', kind='Console', errors='ignore') }}"
set_fact:
has_openshift_console: "{{ console_res | length > 0 and console_res[0].spec.managementState != 'Removed' }}"
when:
- is_openshift == True

- name: Create Kiali objects on OpenShift
include_tasks: process-resource.yml
vars:
Expand Down Expand Up @@ -95,6 +105,8 @@
{% endfor %}
when:
- is_openshift == True
- has_openshift_console is defined
- has_openshift_console == True
- no_longer_accessible_namespaces is defined

- name: Process OpenShift Console Links
Expand Down
13 changes: 13 additions & 0 deletions roles/default/kiali-remove/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,17 @@
when:
- is_openshift == True

# If it is Removed, the web console is disabled.
# See: https://docs.openshift.com/container-platform/4.13/web_console/disabling-web-console.html
- name: Determine if OpenShift Console is installed and enabled
ignore_errors: yes
vars:
console_res: "{{ query('kubernetes.core.k8s', resource_name='cluster', api_version='operator.openshift.io/v1', kind='Console', errors='ignore') }}"
set_fact:
has_openshift_console: "{{ console_res | length > 0 and console_res[0].spec.managementState != 'Removed' }}"
when:
- is_openshift == True

- name: Delete OpenShift-specific Kiali ConsoleLinks
ignore_errors: yes
k8s:
Expand All @@ -254,3 +265,5 @@
{% endfor %}
when:
- is_openshift == True
- has_openshift_console is defined
- has_openshift_console == True
12 changes: 12 additions & 0 deletions roles/v1.73/kiali-deploy/tasks/openshift/os-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@
when:
- is_openshift == True

# If it is Removed, the web console is disabled.
# See: https://docs.openshift.com/container-platform/4.13/web_console/disabling-web-console.html
- name: Determine if OpenShift Console is installed and enabled
vars:
console_res: "{{ query('kubernetes.core.k8s', resource_name='cluster', api_version='operator.openshift.io/v1', kind='Console', errors='ignore') }}"
set_fact:
has_openshift_console: "{{ console_res | length > 0 and console_res[0].spec.managementState != 'Removed' }}"
when:
- is_openshift == True

- name: Create Kiali objects on OpenShift
include_tasks: process-resource.yml
vars:
Expand Down Expand Up @@ -95,6 +105,8 @@
{% endfor %}
when:
- is_openshift == True
- has_openshift_console is defined
- has_openshift_console == True
- no_longer_accessible_namespaces is defined

- name: Process OpenShift Console Links
Expand Down
13 changes: 13 additions & 0 deletions roles/v1.73/kiali-remove/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,17 @@
when:
- is_openshift == True

# If it is Removed, the web console is disabled.
# See: https://docs.openshift.com/container-platform/4.13/web_console/disabling-web-console.html
- name: Determine if OpenShift Console is installed and enabled
ignore_errors: yes
vars:
console_res: "{{ query('kubernetes.core.k8s', resource_name='cluster', api_version='operator.openshift.io/v1', kind='Console', errors='ignore') }}"
set_fact:
has_openshift_console: "{{ console_res | length > 0 and console_res[0].spec.managementState != 'Removed' }}"
when:
- is_openshift == True

- name: Delete OpenShift-specific Kiali ConsoleLinks
ignore_errors: yes
k8s:
Expand All @@ -254,3 +265,5 @@
{% endfor %}
when:
- is_openshift == True
- has_openshift_console is defined
- has_openshift_console == True

0 comments on commit 5498910

Please sign in to comment.