Skip to content

Commit

Permalink
[molecule] skip the OpenShift part of the test if not on OpenShift (#845
Browse files Browse the repository at this point in the history
)
  • Loading branch information
jmazzitelli authored Nov 12, 2024
1 parent a0a43e1 commit c6d50c0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions molecule/common/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
api_groups: "{{ lookup('kubernetes.core.k8s', cluster_info='api_groups') }}"
- name: Determine the cluster type
set_fact:
is_openshift: "{{ True if 'route.openshift.io' in api_groups else False }}"
is_k8s: "{{ False if 'route.openshift.io' in api_groups else True }}"
is_openshift: "{{ True if 'operator.openshift.io' in api_groups else False }}"
is_k8s: "{{ False if 'operator.openshift.io' in api_groups else True }}"
is_minikube: "{{ True if lookup('env', 'MOLECULE_CLUSTER_TYPE') == 'minikube' else False }}"
is_kind: "{{ True if lookup('env', 'MOLECULE_CLUSTER_TYPE') == 'kind' else False }}"

Expand Down
6 changes: 6 additions & 0 deletions molecule/remote-cluster-resources-test/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,12 @@
- query('k8s', kind='ConsoleLink', api_version=apiCoLn, label_selector=querySelector, errors='warn') | length == 0
- query('k8s', kind='OAuthClient', api_version=apiOAut, label_selector=querySelector, errors='warn') | length == 0

###
### The below tests are ONLY executed if on OpenShift; if not OpenShift, exit the test now.
###
- meta: end_play
when: is_openshift == False

- debug: msg="Change auth strategy to openshift to confirm OAuthClient is created"
- include_tasks: ../common/set_kiali_cr.yml
vars:
Expand Down

0 comments on commit c6d50c0

Please sign in to comment.