Skip to content

Commit 6988524

Browse files
committed
Update CRDs when changing test-operator version
This patch updated the CRDs, if the user wants to patch the test operator version. Until now the CRDs stayed unchanged even after version change, so testing new test-operator parameters was not possible.
1 parent 1762e47 commit 6988524

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

roles/test_operator/tasks/main.yml

+50
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,56 @@
118118
)
119119
}}
120120
121+
- name: Delete CRDs created by test-operator
122+
kubernetes.core.k8s:
123+
kubeconfig: "{{ cifmw_openshift_kubeconfig }}"
124+
api_key: "{{ cifmw_openshift_token | default(omit)}}"
125+
context: "{{ cifmw_openshift_context | default(omit)}}"
126+
kind: CustomResourceDefinition
127+
state: absent
128+
api_version: v1
129+
name: "{{ item }}"
130+
namespace: "{{ cifmw_test_operator_namespace }}"
131+
wait: true
132+
wait_timeout: 600
133+
loop:
134+
- tempests.test.openstack.org
135+
- tobikoes.test.openstack.org
136+
- ansibletests.test.openstack.org
137+
- horizontests.test.openstack.org
138+
139+
- name: Ensure required packages are installed
140+
ansible.builtin.package:
141+
name: "{{ item }}"
142+
state: present
143+
loop:
144+
- git
145+
- make
146+
become: true
147+
148+
- name: Clone test-operator repository
149+
ansible.builtin.git:
150+
repo: "{{ cifmw_test_operator_repo }}"
151+
dest: /tmp/test-operator
152+
force: true
153+
refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
154+
155+
- name: Checkout to the right test-operator version
156+
ansible.builtin.git:
157+
repo: "{{ cifmw_test_operator_repo }}"
158+
dest: /tmp/test-operator
159+
version: "{{ cifmw_test_operator_version }}"
160+
force: true
161+
args:
162+
chdir: /tmp/test-operator
163+
164+
- name: Run make generate manifests install
165+
ansible.builtin.shell: >-
166+
set -o pipefail;
167+
make generate manifests install
168+
args:
169+
chdir: /tmp/test-operator
170+
121171
- name: Call test stages loop
122172
when: not cifmw_test_operator_dry_run | bool
123173
ansible.builtin.include_tasks: stages.yml

0 commit comments

Comments
 (0)