Skip to content

Commit b2460ae

Browse files
committed
[set_openstack_operators] Add fallback task for operators not having generic k8s labels
Some of the operators still do not have the generic app.kubernetes.io/name label, and they need to be identified using openstack.org/operator-name label. Signed-off-by: Amartya Sinha <amsinha@redhat.com>
1 parent b954eac commit b2460ae

File tree

1 file changed

+11
-0
lines changed
  • roles/set_openstack_containers/tasks

1 file changed

+11
-0
lines changed

roles/set_openstack_containers/tasks/main.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,17 @@
5959
output_dir: "{{ cifmw_set_openstack_containers_basedir }}/artifacts"
6060
script: "oc set env $(oc get pods -n {{ operator_namespace }} -o name -l app.kubernetes.io/name={{ operator_name }}-operator) -n {{ operator_namespace }} --list"
6161
register: containers_env_list
62+
ignore_errors: true
63+
64+
- name: Get meta operator environment variable (for operators not having generic kubernetes label)
65+
environment:
66+
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
67+
PATH: "{{ cifmw_path }}"
68+
cifmw.general.ci_script:
69+
output_dir: "{{ cifmw_set_openstack_containers_basedir }}/artifacts"
70+
script: "oc set env $(oc get pods -n {{ operator_namespace }} -o name -l openstack.org/operator-name={{ operator_name }}) -n {{ operator_namespace }} --list"
71+
register: containers_env_list
72+
when: containers_env_list.failed
6273

6374
- name: Generate update_env_vars.sh script
6475
ansible.builtin.template:

0 commit comments

Comments
 (0)