Skip to content

Commit bf55f41

Browse files
lmicciniclaude
authored andcommitted
[multi-namespace] Skip container image update when primary NS has no overrides
The ns2_update_containers playbook unconditionally applies custom container images to the openstack2 namespace using CI parameter variables (registry, org, tag). However, when the primary openstack namespace does not have customContainerImages set on its OpenStackVersion CR, those CI parameters produce incorrect images that override the correct operator defaults. Add a pre-check that reads the primary namespace's OpenStackVersion customContainerImages. If empty, skip the update_containers role so that openstack2 uses the same operator defaults as openstack. Signed-off-by: Luca Miccini <lmiccini@redhat.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 9d54532 commit bf55f41

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

playbooks/multi-namespace/ns2_update_containers.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@
66
ansible.builtin.include_vars:
77
dir: "{{ cifmw_basedir }}/artifacts/parameters"
88

9+
- name: Check if primary namespace has customContainerImages
10+
environment:
11+
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
12+
PATH: "{{ cifmw_path }}"
13+
ansible.builtin.command:
14+
cmd: >-
15+
oc get openstackversion
16+
-n {{ cifmw_openstack_namespace }}
17+
-o jsonpath='{.items[0].spec.customContainerImages}'
18+
register: _primary_custom_images
19+
changed_when: false
20+
921
- name: "Update containers in {{ cifmw_update_containers_namespace }}"
22+
when:
23+
- _primary_custom_images.stdout not in ['', '{}']
1024
ansible.builtin.include_role:
1125
name: update_containers

0 commit comments

Comments
 (0)