Skip to content

Commit 85e4d2a

Browse files
committed
Fix kuttl jobs by adding webhooks
1 parent 8c8ce8a commit 85e4d2a

File tree

12 files changed

+150
-84
lines changed

12 files changed

+150
-84
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
1517
zuul_log_collection: true
16-
post-run:
17-
- ci/nova-operator-base/playbooks/collect-logs.yaml
18+
nova_repo: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/nova-operator"
19+
nova_hook: "{{ nova_repo }}/ci/playbooks/deploy_nova_service.yaml"
20+
pre_tests:
21+
- name: Deploy nova service
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: nova
435+
nova: export CATALOG_IMG=${CATALOG_IMAGE}
436+
nova: ## 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"

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

ci/olm.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
apiVersion: v1
3+
kind: Namespace
4+
metadata:
5+
name: openstack-operators
6+
labels:
7+
pod-security.kubernetes.io/enforce: privileged
8+
security.openshift.io/scc.podSecurityLabelSync: "false"
9+
---
10+
apiVersion: operators.coreos.com/v1alpha1
11+
kind: CatalogSource
12+
metadata:
13+
name: nova-operator-index
14+
namespace: openstack-operators
15+
spec:
16+
image: quay.io/openstack-k8s-operators/nova-operator-index:latest
17+
sourceType: grpc
18+
---
19+
apiVersion: operators.coreos.com/v1
20+
kind: OperatorGroup
21+
metadata:
22+
name: openstack
23+
namespace: openstack-operators
24+
---
25+
apiVersion: operators.coreos.com/v1alpha1
26+
kind: Subscription
27+
metadata:
28+
name: nova-operator
29+
namespace: openstack-operators
30+
spec:
31+
name: nova-operator
32+
channel: alpha
33+
source: nova-operator-index
34+
sourceNamespace: openstack-operators
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
- name: Deploy Nova service
3+
hosts: "{{ cifmw_target_hook_host | default('localhost') }}"
4+
gather_facts: false
5+
environment:
6+
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
7+
PATH: "{{ cifmw_path }}"
8+
tasks:
9+
- name: Collect general openshift cr info
10+
ansible.builtin.shell: |
11+
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"}]"
12+
- name: Install Nova Operator
13+
cifmw.general.ci_script:
14+
output_dir: "{{ cifmw_basedir }}/artifacts"
15+
chdir: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/nova-operator"
16+
script: make nova
17+
extra_args:
18+
CATALOG_IMAGE: "{{ nova_catalog_image | default('quay.io/openstack-k8s-operators/nova-operator-index:latest') }}"
19+
20+
# - name: Deploy nova service
21+
# when: deploy_nova_service | default('true') | bool
22+
# cifmw.general.ci_script:
23+
# output_dir: "{{ cifmw_basedir }}/artifacts"
24+
# chdir: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/nova-operator"
25+
# script: make nova_deploy

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/deps/OpenStackControlPlane.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,3 @@ spec:
1919
manilaShares: {}
2020
horizon:
2121
enabled: false
22-
nova:
23-
enabled: true

test/kuttl/test-suites/default/deps/kustomization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,4 @@ patches:
4040
- path: infra.yaml
4141
- path: keystone.yaml
4242
- path: placement.yaml
43+
- path: nova.yaml

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)