diff --git a/.zuul.yaml b/.zuul.yaml index 203e198bf..0bf53d4f6 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -9,12 +9,20 @@ This job deploy a basic "Compute Starter Kit" topology https://www.openstack.org/software/sample-configs#compute-starter-kit that is the minium set of openstack services required to boot a vm. + post-run: + - ci/nova-operator-base/playbooks/collect-logs.yaml vars: collection_namespace_override: "nova-kuttl-default" operator_name: nova-operator + nova_repo: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/nova-operator" zuul_log_collection: true - post-run: - - ci/nova-operator-base/playbooks/collect-logs.yaml + nova_hook: "{{ ansible_user_dir }}/{{ zuul.projects['github.com/openstack-k8s-operators/nova-operator'].src_dir }}/ci/nova-operator-kuttl/deploy_webhooks.yaml" + pre_kuttl_from_operator: + - name: 70 Create nova webhooks + 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: @@ -179,11 +187,12 @@ name: openstack-k8s-operators/nova-operator default-branch: main github-check: + debug: true jobs: - openstack-meta-content-provider - nova-operator-kuttl - - nova-operator-tempest-multinode - - nova-operator-tempest-multinode-ceph + # - nova-operator-tempest-multinode + # - nova-operator-tempest-multinode-ceph - pragma: implied-branch-matchers: True diff --git a/Makefile b/Makefile index 16bd981d6..504489bb5 100644 --- a/Makefile +++ b/Makefile @@ -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)) @@ -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: run_with_olm +run_with_olm: export CATALOG_IMG=${CATALOG_IMAGE} +run_with_olm: ## 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" diff --git a/ci/nova-operator-kuttl/deploy_webhooks.yaml b/ci/nova-operator-kuttl/deploy_webhooks.yaml new file mode 100644 index 000000000..b307dab0a --- /dev/null +++ b/ci/nova-operator-kuttl/deploy_webhooks.yaml @@ -0,0 +1,17 @@ +- name: Create custom service + hosts: "{{ cifmw_target_hook_host | default('localhost') }}" + environment: + KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}" + PATH: "{{ cifmw_path }}" + gather_facts: false + tasks: + - name: Scale down deployment + 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 run_with_olm + extra_args: + CATALOG_IMAGE: "{{ nova_catalog_image }}" diff --git a/ci/olm.sh b/ci/olm.sh new file mode 100644 index 000000000..bf05c96d9 --- /dev/null +++ b/ci/olm.sh @@ -0,0 +1,36 @@ +cat > ci/olm.yaml <