Skip to content

Commit bae9492

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

File tree

7 files changed

+114
-4
lines changed

7 files changed

+114
-4
lines changed

.zuul.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,16 @@
1313
collection_namespace_override: "nova-kuttl-default"
1414
operator_name: nova-operator
1515
zuul_log_collection: true
16-
post-run:
17-
- ci/nova-operator-base/playbooks/collect-logs.yaml
16+
nova_repo: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/nova-operator"
17+
nova_hook: "{{ nova_repo }}/ci/playbooks/deploy_nova_service.yaml"
18+
post-run:
19+
- ci/nova-operator-base/playbooks/collect-logs.yaml
20+
post_deploy:
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: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
- name: Deploy Nova service
2+
hosts: "{{ cifmw_target_hook_host | default('localhost') }}"
3+
gather_facts: false
4+
environment:
5+
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
6+
PATH: "{{ cifmw_path }}"
7+
tasks:
8+
- name: Collect general openshift cr info
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 nova
16+
extra_args:
17+
CATALOG_IMAGE: "{{ nova_catalog_image | default('quay.io/openstack-k8s-operators/nova-operator-index:latest') }}"
18+
19+
# - name: Deploy nova service
20+
# when: deploy_nova_service | default('true') | bool
21+
# cifmw.general.ci_script:
22+
# output_dir: "{{ cifmw_basedir }}/artifacts"
23+
# chdir: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/nova-operator"
24+
# script: make nova_deploy

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

0 commit comments

Comments
 (0)