Skip to content

Commit

Permalink
[test-operator] Fix volume mounting
Browse files Browse the repository at this point in the history
In this patch we introduced a small bug that appears when we run both
tempest and tobiko tests in a single job [1]. The issue is that when
tobiko is executed both variables volume and volume_mounts contain
values from the tempest run.

This PR ensures that both volume and volume_mounts are initialized to
an empty list when logs are being collected. Additionaly, this patch
fixes the copying of logs from logs pod.

[1] #2124
  • Loading branch information
lpiwowar authored and openshift-merge-bot[bot] committed Jul 29, 2024
1 parent 904e26b commit 1772ae6
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion roles/test_operator/tasks/run-test-operator-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@
- not cifmw_test_operator_dry_run | bool
- not testjob_timed_out
block:
- name: Reset volumes and volume_mounts to an empty list
ansible.builtin.set_fact:
volumes: []
volume_mounts: []

- name: Get information about PVCs that store the logs
kubernetes.core.k8s_info:
kubeconfig: "{{ cifmw_openshift_kubeconfig }}"
Expand Down Expand Up @@ -140,10 +145,15 @@
environment:
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
PATH: "{{ cifmw_path }}"
vars:
pod_path: mnt/logs-{{ test_operator_job_name }}-step-{{ index }}
ansible.builtin.shell: >
oc cp -n {{ cifmw_test_operator_namespace }}
openstack/test-operator-logs-pod-{{ run_test_fw }}:mnt/
openstack/test-operator-logs-pod-{{ run_test_fw }}:{{ pod_path }}
{{ cifmw_test_operator_artifacts_basedir }}
loop: "{{ logsPVCs.resources }}"
loop_control:
index_var: index

- name: Get list of all pods
kubernetes.core.k8s_info:
Expand Down

0 comments on commit 1772ae6

Please sign in to comment.