Skip to content

Commit 737e4ff

Browse files
lmicciniclaude
authored andcommitted
[kustomize_deploy] Fix wait conditions not reflecting uniquified OSDPD names
After uniquify_osdpd.py renames OpenStackDataPlaneDeployment resources with a timestamp suffix, the wait conditions still reference the original names, causing "NotFound" errors. Update _wait_conditions after the rename step by parsing the script's "Renamed: old -> new" output. Signed-off-by: Luca Miccini <lmiccini@redhat.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4f7c7fd commit 737e4ff

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

roles/kustomize_deploy/tasks/execute_step.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,30 @@
265265
register: _rename_osdpd
266266
changed_when: "'Renamed:' in _rename_osdpd.stdout"
267267

268+
- name: "Update wait conditions with uniquified OSDPD names"
269+
when:
270+
- _rename_osdpd is defined
271+
- _rename_osdpd is not skipped
272+
- _rename_osdpd.stdout is defined
273+
- "'Renamed:' in _rename_osdpd.stdout"
274+
ansible.builtin.set_fact:
275+
_wait_conditions: >-
276+
{{
277+
_wait_conditions | map('regex_replace',
278+
'(?i)((?:openstackdataplanedeployment|osdpd)\s+)(' + item.split(' -> ')[0] | trim + ')(\s|$)',
279+
'\1' + item.split(' -> ')[1] | trim + '\3'
280+
) | list
281+
}}
282+
loop: >-
283+
{{
284+
_rename_osdpd.stdout_lines |
285+
select('match', '^Renamed:') |
286+
map('regex_replace', '^Renamed:\s*', '') |
287+
list
288+
}}
289+
loop_control:
290+
label: "{{ item }}"
291+
268292
- name: "Store kustomized content in artifacts for {{ stage.path }}"
269293
ansible.builtin.copy:
270294
remote_src: true

0 commit comments

Comments
 (0)