Skip to content

Commit 2013932

Browse files
committed
Get cinder pod name
As [1] was merged, testproject failed as cinder-api pod was hardcoded to cinder-api-0 which doesn't work where uniquepodnames are turned on. This patch gets pod name first to access cinder services later on Jira: OSPRH-15353 [1] #962
1 parent 3e09afd commit 2013932

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

tests/roles/cinder_adoption/tasks/main.yaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414
retries: 60
1515
delay: 2
1616

17+
- name: Get cinder-api pod name
18+
ansible.builtin.shell: |
19+
{{ shell_header }}
20+
{{ oc_header }}
21+
oc get pods -l component=cinder-api -o custom-columns="NAME:.metadata.name" --no-headers | head -1
22+
register: cinder_api_pod
23+
1724
- name: check that Cinder is reachable and its endpoints are defined
1825
ansible.builtin.shell: |
1926
{{ shell_header }}
@@ -37,7 +44,7 @@
3744
ansible.builtin.shell: |
3845
{{ shell_header }}
3946
{{ oc_header }}
40-
oc exec -t cinder-api-0 -c cinder-api -- cinder-manage service remove cinder-backup "{{ item }}"
47+
oc exec -t "{{ cinder_api_pod.stdout }}" -c cinder-api -- cinder-manage service remove cinder-backup "{{ item }}"
4148
loop: "{{ backup_down_services.stdout_lines }}"
4249

4350
- name: Get cinder-scheduler down services
@@ -51,7 +58,7 @@
5158
ansible.builtin.shell: |
5259
{{ shell_header }}
5360
{{ oc_header }}
54-
oc exec -t cinder-api-0 -c cinder-api -- cinder-manage service remove cinder-scheduler "{{ item }}"
61+
oc exec -t "{{ cinder_api_pod.stdout }}" -c cinder-api -- cinder-manage service remove cinder-scheduler "{{ item }}"
5562
loop: "{{ scheduler_down_services.stdout_lines }}"
5663

5764
- name: deploy podified Cinder scheduler
@@ -137,4 +144,4 @@
137144
ansible.builtin.shell: |
138145
{{ shell_header }}
139146
{{ oc_header }}
140-
oc exec -t cinder-api-0 -c cinder-api -- cinder-manage db online_data_migrations
147+
oc exec -t "{{ cinder_api_pod.stdout }}" -c cinder-api -- cinder-manage db online_data_migrations

0 commit comments

Comments
 (0)