Skip to content

Commit

Permalink
Fix kuttl jobs by adding webhooks
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkisaolamb committed Feb 11, 2025
1 parent 8c8ce8a commit 18d6ba3
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .zuul.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,16 @@
collection_namespace_override: "nova-kuttl-default"
operator_name: nova-operator
zuul_log_collection: true
nova_repo: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/nova-operator"
nova_hook: "{{ nova_repo }}/ci/playbooks/deploy_nova_service.yaml"
post-run:
- ci/nova-operator-base/playbooks/collect-logs.yaml
post_deploy:
- name: Deploy nova service
type: playbook
source: "{{ nova_hook }}"
extra_vars:
nova_catalog_image: "{{ content_provider_registry_ip }}:5001/openstack-k8s-operators/nova-operator-index:{{ zuul.patchset }}"
extra-vars:
crc_ci_bootstrap_networking:
networks:
Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ DEFAULT_IMG ?= quay.io/openstack-k8s-operators/nova-operator:latest
IMG ?= $(DEFAULT_IMG)
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.29
CATALOG_IMAGE ?= quay.io/openstack-k8s-operators/nova-operator-index:latest

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand Down Expand Up @@ -428,3 +429,11 @@ PHONY: crd-schema-check
crd-schema-check: manifests
INSTALL_DIR=$(LOCALBIN) CRD_SCHEMA_CHECKER_VERSION=$(CRD_SCHEMA_CHECKER_VERSION) hack/build-crd-schema-checker.sh
INSTALL_DIR=$(LOCALBIN) BASE_REF="$${PULL_BASE_SHA:-$(BRANCH)}" hack/crd-schema-checker.sh


.PHONY: nova
nova: export CATALOG_IMG=${CATALOG_IMAGE}
nova: ## Install nova operator via olm
bash ci/olm.sh
oc apply -f ci/olm.yaml
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"
36 changes: 36 additions & 0 deletions ci/olm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
cat > ci/olm.yaml <<EOF_CAT
---
apiVersion: v1
kind: Namespace
metadata:
name: openstack-operators
labels:
pod-security.kubernetes.io/enforce: privileged
security.openshift.io/scc.podSecurityLabelSync: "false"
---
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
name: nova-operator-index
namespace: openstack-operators
spec:
image: ${CATALOG_IMG}
sourceType: grpc
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: openstack
namespace: openstack-operators
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: nova-operator
namespace: openstack-operators
spec:
name: nova-operator
channel: alpha
source: nova-operator-index
sourceNamespace: openstack-operators
EOF_CAT
34 changes: 34 additions & 0 deletions ci/olm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: openstack-operators
labels:
pod-security.kubernetes.io/enforce: privileged
security.openshift.io/scc.podSecurityLabelSync: "false"
---
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
name: nova-operator-index
namespace: openstack-operators
spec:
image: quay.io/openstack-k8s-operators/nova-operator-index:latest
sourceType: grpc
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: openstack
namespace: openstack-operators
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: nova-operator
namespace: openstack-operators
spec:
name: nova-operator
channel: alpha
source: nova-operator-index
sourceNamespace: openstack-operators
24 changes: 24 additions & 0 deletions ci/playbook/deploy_nova_service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
- name: Deploy Nova service
hosts: "{{ cifmw_target_hook_host | default('localhost') }}"
gather_facts: false
environment:
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
PATH: "{{ cifmw_path }}"
tasks:
- name: Collect general openshift cr info
ansible.builtin.shell: |
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"}]"
- name: Install Nova Operator
cifmw.general.ci_script:
output_dir: "{{ cifmw_basedir }}/artifacts"
chdir: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/nova-operator"
script: make nova
extra_args:
CATALOG_IMAGE: "{{ nova_catalog_image | default('quay.io/openstack-k8s-operators/nova-operator-index:latest') }}"

# - name: Deploy nova service
# when: deploy_nova_service | default('true') | bool
# cifmw.general.ci_script:
# output_dir: "{{ cifmw_basedir }}/artifacts"
# chdir: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/nova-operator"
# script: make nova_deploy
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,3 @@ spec:
manilaShares: {}
horizon:
enabled: false
nova:
enabled: true
1 change: 1 addition & 0 deletions test/kuttl/test-suites/default/deps/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ patches:
- path: infra.yaml
- path: keystone.yaml
- path: placement.yaml
- path: nova.yaml

0 comments on commit 18d6ba3

Please sign in to comment.