Skip to content

Commit e7cb5c1

Browse files
lmicciniclaude
authored andcommitted
[federation] Fix race condition with openstackclient pod readiness
After Keystone reconfiguration the openstackclient pod may restart, causing oc exec commands to fail with "pods openstackclient not found". Add a readiness wait before running OpenStack setup commands, and add retries to run_osp_cmd.yml matching the pattern used by the ipa role. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Luca Miccini <lmiccini@redhat.com>
1 parent 8a15a5f commit e7cb5c1

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

roles/federation/tasks/hook_post_deploy.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,22 @@
3030
retries: 30
3131
delay: 20
3232

33+
- name: Wait for openstackclient pod to be ready
34+
kubernetes.core.k8s_info:
35+
kubeconfig: "{{ cifmw_openshift_kubeconfig }}"
36+
api_version: v1
37+
kind: Pod
38+
name: openstackclient
39+
namespace: "{{ cifmw_federation_run_osp_cmd_namespace }}"
40+
register: _openstackclient_pod
41+
until: >-
42+
_openstackclient_pod.resources | length > 0 and
43+
(_openstackclient_pod.resources[0].status.phase | default('') == 'Running') and
44+
(_openstackclient_pod.resources[0].status.containerStatuses | default([]) |
45+
selectattr('ready', 'equalto', true) | list | length > 0)
46+
retries: 30
47+
delay: 10
48+
3349
- name: Build realm configurations for single realm OpenStack setup
3450
ansible.builtin.set_fact:
3551
_federation_openstack_realms_to_process:

roles/federation/tasks/run_osp_cmd.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@
2626
--
2727
{{ _osp_cmd }}
2828
register: federation_run_ocp_cmd
29+
retries: 10
30+
delay: 10

0 commit comments

Comments
 (0)