Skip to content

Commit c2dc4e3

Browse files
committed
Fix kuttl jobs by adding webhooks
1 parent 0933c97 commit c2dc4e3

File tree

9 files changed

+107
-82
lines changed

9 files changed

+107
-82
lines changed

.zuul.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,20 @@
99
This job deploy a basic "Compute Starter Kit" topology
1010
https://www.openstack.org/software/sample-configs#compute-starter-kit
1111
that is the minium set of openstack services required to boot a vm.
12+
post-run:
13+
- ci/nova-operator-base/playbooks/collect-logs.yaml
1214
vars:
1315
collection_namespace_override: "nova-kuttl-default"
1416
operator_name: nova-operator
17+
nova_repo: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/nova-operator"
1518
zuul_log_collection: true
16-
post-run:
17-
- ci/nova-operator-base/playbooks/collect-logs.yaml
19+
nova_hook: "{{ ansible_user_dir }}/{{ zuul.projects['github.com/openstack-k8s-operators/nova-operator'].src_dir }}/ci/nova-operator-kuttl/deploy_webhooks.yaml"
20+
pre_kuttl_from_operator:
21+
- name: 70 Create nova webhooks
22+
type: playbook
23+
source: "{{ nova_hook }}"
24+
extra_vars:
25+
nova_catalog_image: "{{ content_provider_registry_ip }}:5001/openstack-k8s-operators/nova-operator-index:{{ zuul.patchset }}"
1826
extra-vars:
1927
crc_ci_bootstrap_networking:
2028
networks:

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ DEFAULT_IMG ?= quay.io/openstack-k8s-operators/nova-operator:latest
5555
IMG ?= $(DEFAULT_IMG)
5656
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
5757
ENVTEST_K8S_VERSION = 1.29
58+
CATALOG_IMAGE ?= quay.io/openstack-k8s-operators/nova-operator-index:latest
5859

5960
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
6061
ifeq (,$(shell go env GOBIN))
@@ -428,3 +429,11 @@ PHONY: crd-schema-check
428429
crd-schema-check: manifests
429430
INSTALL_DIR=$(LOCALBIN) CRD_SCHEMA_CHECKER_VERSION=$(CRD_SCHEMA_CHECKER_VERSION) hack/build-crd-schema-checker.sh
430431
INSTALL_DIR=$(LOCALBIN) BASE_REF="$${PULL_BASE_SHA:-$(BRANCH)}" hack/crd-schema-checker.sh
432+
433+
434+
.PHONY: run_with_olm
435+
run_with_olm: export CATALOG_IMG=${CATALOG_IMAGE}
436+
run_with_olm: ## Install nova operator via olm
437+
bash ci/olm.sh
438+
oc apply -f ci/olm.yaml
439+
timeout 300s bash -c "while ! (oc get csv -n openstack-operators -l operators.coreos.com/nova-operator.openstack-operators -o jsonpath='{.items[*].status.phase}' | grep Succeeded); do sleep 1; done"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
- name: Create custom service
2+
hosts: "{{ cifmw_target_hook_host | default('localhost') }}"
3+
environment:
4+
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
5+
PATH: "{{ cifmw_path }}"
6+
gather_facts: false
7+
tasks:
8+
- name: Scale down deployment
9+
ansible.builtin.shell: |
10+
oc patch csv -n openstack-operators openstack-operator.v0.0.1 --type json -p="[{"op": "replace", "path": "/spec/install/spec/deployments/0/spec/replicas", "value": "0"}]"
11+
- name: Install Nova Operator
12+
cifmw.general.ci_script:
13+
output_dir: "{{ cifmw_basedir }}/artifacts"
14+
chdir: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/nova-operator"
15+
script: make run_with_olm
16+
extra_args:
17+
CATALOG_IMAGE: "{{ nova_catalog_image }}"

ci/olm.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
cat > ci/olm.yaml <<EOF_CAT
2+
---
3+
apiVersion: v1
4+
kind: Namespace
5+
metadata:
6+
name: openstack-operators
7+
labels:
8+
pod-security.kubernetes.io/enforce: privileged
9+
security.openshift.io/scc.podSecurityLabelSync: "false"
10+
---
11+
apiVersion: operators.coreos.com/v1alpha1
12+
kind: CatalogSource
13+
metadata:
14+
name: nova-operator-index
15+
namespace: openstack-operators
16+
spec:
17+
image: ${CATALOG_IMG}
18+
sourceType: grpc
19+
---
20+
apiVersion: operators.coreos.com/v1
21+
kind: OperatorGroup
22+
metadata:
23+
name: openstack
24+
namespace: openstack-operators
25+
---
26+
apiVersion: operators.coreos.com/v1alpha1
27+
kind: Subscription
28+
metadata:
29+
name: nova-operator
30+
namespace: openstack-operators
31+
spec:
32+
name: nova-operator
33+
channel: alpha
34+
source: nova-operator-index
35+
sourceNamespace: openstack-operators
36+
EOF_CAT

test/kuttl/test-suites/default/cell-tests/01-assert.yaml

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,10 @@ metadata:
138138
name: nova-kuttl-api-0
139139
status:
140140
containerStatuses:
141-
- image: quay.io/podified-antelope-centos9/openstack-nova-api:current-podified
142-
name: nova-kuttl-api-api
141+
- name: nova-kuttl-api-api
143142
ready: true
144143
started: true
145-
- image: quay.io/podified-antelope-centos9/openstack-nova-api:current-podified
146-
name: nova-kuttl-api-log
144+
- name: nova-kuttl-api-log
147145
ready: true
148146
started: true
149147
---
@@ -161,8 +159,7 @@ metadata:
161159
name: nova-kuttl-scheduler
162160
status:
163161
containerStatuses:
164-
- image: quay.io/podified-antelope-centos9/openstack-nova-scheduler:current-podified
165-
name: nova-kuttl-scheduler-scheduler
162+
- name: nova-kuttl-scheduler-scheduler
166163
ready: true
167164
started: true
168165
---
@@ -183,12 +180,10 @@ metadata:
183180
name: nova-kuttl-metadata
184181
status:
185182
containerStatuses:
186-
- image: quay.io/podified-antelope-centos9/openstack-nova-api:current-podified
187-
name: nova-kuttl-metadata-log
183+
- name: nova-kuttl-metadata-log
188184
ready: true
189185
started: true
190-
- image: quay.io/podified-antelope-centos9/openstack-nova-api:current-podified
191-
name: nova-kuttl-metadata-metadata
186+
- name: nova-kuttl-metadata-metadata
192187
ready: true
193188
started: true
194189
---
@@ -210,8 +205,7 @@ metadata:
210205
name: nova-kuttl-cell0-conductor
211206
status:
212207
containerStatuses:
213-
- image: quay.io/podified-antelope-centos9/openstack-nova-conductor:current-podified
214-
name: nova-kuttl-cell0-conductor-conductor
208+
- name: nova-kuttl-cell0-conductor-conductor
215209
ready: true
216210
started: true
217211
---
@@ -232,8 +226,7 @@ metadata:
232226
name: nova-kuttl-cell1-conductor
233227
status:
234228
containerStatuses:
235-
- image: quay.io/podified-antelope-centos9/openstack-nova-conductor:current-podified
236-
name: nova-kuttl-cell1-conductor-conductor
229+
- name: nova-kuttl-cell1-conductor-conductor
237230
ready: true
238231
started: true
239232
---
@@ -537,7 +530,6 @@ spec:
537530
value: COPY_ALWAYS
538531
- name: PURGE_AGE
539532
value: "90"
540-
image: quay.io/podified-antelope-centos9/openstack-nova-conductor:current-podified
541533
name: nova-manage
542534
securityContext:
543535
runAsUser: 42436
@@ -595,7 +587,6 @@ spec:
595587
value: COPY_ALWAYS
596588
- name: PURGE_AGE
597589
value: "90"
598-
image: quay.io/podified-antelope-centos9/openstack-nova-conductor:current-podified
599590
name: nova-manage
600591
securityContext:
601592
runAsUser: 42436

test/kuttl/test-suites/default/scale-tests/01-assert.yaml

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,10 @@ metadata:
138138
name: nova-kuttl-api-0
139139
status:
140140
containerStatuses:
141-
- image: quay.io/podified-antelope-centos9/openstack-nova-api:current-podified
142-
name: nova-kuttl-api-api
141+
- name: nova-kuttl-api-api
143142
ready: true
144143
started: true
145-
- image: quay.io/podified-antelope-centos9/openstack-nova-api:current-podified
146-
name: nova-kuttl-api-log
144+
- name: nova-kuttl-api-log
147145
ready: true
148146
started: true
149147
---
@@ -161,8 +159,7 @@ metadata:
161159
name: nova-kuttl-scheduler
162160
status:
163161
containerStatuses:
164-
- image: quay.io/podified-antelope-centos9/openstack-nova-scheduler:current-podified
165-
name: nova-kuttl-scheduler-scheduler
162+
- name: nova-kuttl-scheduler-scheduler
166163
ready: true
167164
started: true
168165
---
@@ -183,12 +180,10 @@ metadata:
183180
name: nova-kuttl-metadata
184181
status:
185182
containerStatuses:
186-
- image: quay.io/podified-antelope-centos9/openstack-nova-api:current-podified
187-
name: nova-kuttl-metadata-log
183+
- name: nova-kuttl-metadata-log
188184
ready: true
189185
started: true
190-
- image: quay.io/podified-antelope-centos9/openstack-nova-api:current-podified
191-
name: nova-kuttl-metadata-metadata
186+
- name: nova-kuttl-metadata-metadata
192187
ready: true
193188
started: true
194189
---
@@ -210,8 +205,7 @@ metadata:
210205
name: nova-kuttl-cell0-conductor
211206
status:
212207
containerStatuses:
213-
- image: quay.io/podified-antelope-centos9/openstack-nova-conductor:current-podified
214-
name: nova-kuttl-cell0-conductor-conductor
208+
- name: nova-kuttl-cell0-conductor-conductor
215209
ready: true
216210
started: true
217211
---
@@ -232,8 +226,7 @@ metadata:
232226
name: nova-kuttl-cell1-conductor
233227
status:
234228
containerStatuses:
235-
- image: quay.io/podified-antelope-centos9/openstack-nova-conductor:current-podified
236-
name: nova-kuttl-cell1-conductor-conductor
229+
- name: nova-kuttl-cell1-conductor-conductor
237230
ready: true
238231
started: true
239232
---
@@ -537,7 +530,6 @@ spec:
537530
value: COPY_ALWAYS
538531
- name: PURGE_AGE
539532
value: "90"
540-
image: quay.io/podified-antelope-centos9/openstack-nova-conductor:current-podified
541533
name: nova-manage
542534
securityContext:
543535
runAsUser: 42436
@@ -595,7 +587,6 @@ spec:
595587
value: COPY_ALWAYS
596588
- name: PURGE_AGE
597589
value: "90"
598-
image: quay.io/podified-antelope-centos9/openstack-nova-conductor:current-podified
599590
name: nova-manage
600591
securityContext:
601592
runAsUser: 42436

0 commit comments

Comments
 (0)