From dfc4cc102d734526365f116be46ca119d65dbf30 Mon Sep 17 00:00:00 2001 From: Amit Uniyal Date: Mon, 18 Nov 2024 14:43:00 +0530 Subject: [PATCH 1/6] Functional test dbpurge job Nova operator's dbpurge job should assigned a node Closes #OSPRH-10765 --- test/functional/novaconductor_controller_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/functional/novaconductor_controller_test.go b/test/functional/novaconductor_controller_test.go index f4c5a4753..b15d82fd9 100644 --- a/test/functional/novaconductor_controller_test.go +++ b/test/functional/novaconductor_controller_test.go @@ -249,6 +249,8 @@ var _ = Describe("NovaConductor controller", func() { k8sClient.Delete, ctx, CreateDefaultCellInternalSecret(cell0)) spec := GetDefaultNovaConductorSpec(cell0) + newSelector := map[string]string{"foo": "bar"} + spec["nodeSelector"] = &newSelector DeferCleanup(th.DeleteInstance, CreateNovaConductor(cell0.ConductorName, spec)) th.ExpectCondition( @@ -376,6 +378,11 @@ var _ = Describe("NovaConductor controller", func() { Equal(fmt.Sprintf("%d", *conductor.Spec.DBPurge.ArchiveAge))) Expect(GetEnvVarValue(jobEnv, "PURGE_AGE", "")).To( Equal(fmt.Sprintf("%d", *conductor.Spec.DBPurge.PurgeAge))) + service := cron.Spec.JobTemplate.Labels["service"] + Expect(service).To(Equal("nova-conductor")) + nodeSelector := cron.Spec.JobTemplate.Spec.Template.Spec.NodeSelector + Expect(nodeSelector).NotTo(BeNil()) + Expect(nodeSelector).To(Equal(map[string]string{"foo": "bar"})) th.ExpectCondition( cell0.ConductorName, From 21d8169e453e704189fd56a09a2bbdeaf7c7fee1 Mon Sep 17 00:00:00 2001 From: Kamil Sambor Date: Tue, 26 Nov 2024 14:50:41 +0100 Subject: [PATCH 2/6] [make][pre-commit]Check CRD schema to avoid update issues The new crd-schema-check make target compares the CRD schema of the patch with the schema on the tip of main and report errors on non backward compatible changes. This make target now also run in pre-commit both locally and in CI. This make target uses https://github.com/openshift/crd-schema-checker to do the actual checking. Related: OSPRH-11833 --- .pre-commit-config.yaml | 6 ++++++ Makefile | 8 ++++++++ hack/build-crd-schema-checker.sh | 15 +++++++++++++++ hack/crd-schema-checker.sh | 21 +++++++++++++++++++++ 4 files changed, 50 insertions(+) create mode 100755 hack/build-crd-schema-checker.sh create mode 100755 hack/crd-schema-checker.sh diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5e79716b9..496fa30b0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,6 +31,12 @@ repos: entry: make args: ['bundle', 'VERSION=0.0.1'] pass_filenames: false + - id: make-crd-schema-check + name: make-crd-schema-check + language: system + entry: make + args: ['crd-schema-check'] + pass_filenames: false - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.4.0 diff --git a/Makefile b/Makefile index b95066645..0f5a9371b 100644 --- a/Makefile +++ b/Makefile @@ -420,3 +420,11 @@ kuttl-test-cleanup: else \ echo "Namespce already cleaned up. Nothing to do"; \ fi + +CRD_SCHEMA_CHECKER_VERSION ?= release-4.16 +BRANCH=main + +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 diff --git a/hack/build-crd-schema-checker.sh b/hack/build-crd-schema-checker.sh new file mode 100755 index 000000000..12bf3be9a --- /dev/null +++ b/hack/build-crd-schema-checker.sh @@ -0,0 +1,15 @@ +#!/bin/bash +set -euxo pipefail + +if [ -f "$INSTALL_DIR/crd-schema-checker" ]; then + exit 0 +fi + +mkdir -p "$INSTALL_DIR/git-tmp" +git clone https://github.com/openshift/crd-schema-checker.git \ + -b "$CRD_SCHEMA_CHECKER_VERSION" "$INSTALL_DIR/git-tmp" +pushd "$INSTALL_DIR/git-tmp" +GOWORK=off make +cp crd-schema-checker "$INSTALL_DIR/" +popd +rm -rf "$INSTALL_DIR/git-tmp" diff --git a/hack/crd-schema-checker.sh b/hack/crd-schema-checker.sh new file mode 100755 index 000000000..c431ae50b --- /dev/null +++ b/hack/crd-schema-checker.sh @@ -0,0 +1,21 @@ +#!/bin/bash +set -euxo pipefail + +CHECKER=$INSTALL_DIR/crd-schema-checker + +TMP_DIR=$(mktemp -d) + +function cleanup { + rm -rf "$TMP_DIR" +} + +trap cleanup EXIT + + +for crd in config/crd/bases/*.yaml; do + mkdir -p "$(dirname "$TMP_DIR/$crd")" + git show "$BASE_REF:$crd" > "$TMP_DIR/$crd" + $CHECKER check-manifests \ + --existing-crd-filename="$TMP_DIR/$crd" \ + --new-crd-filename="$crd" +done From 9fc965787f1b038ec6c5755aca7ce4efec2d4590 Mon Sep 17 00:00:00 2001 From: OpenStack K8s CI Date: Sat, 23 Nov 2024 05:41:33 +0000 Subject: [PATCH 3/6] Update k8s.io to v0.29.11 --- api/go.mod | 10 +++++----- api/go.sum | 20 ++++++++++---------- go.mod | 10 +++++----- go.sum | 20 ++++++++++---------- 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/api/go.mod b/api/go.mod index 108fd68fc..95b009815 100644 --- a/api/go.mod +++ b/api/go.mod @@ -6,8 +6,8 @@ require ( github.com/google/go-cmp v0.6.0 github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20241113144931-ff1fd2dcd04a github.com/robfig/cron/v3 v3.0.1 - k8s.io/api v0.29.10 - k8s.io/apimachinery v0.29.10 + k8s.io/api v0.29.11 + k8s.io/apimachinery v0.29.11 k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 sigs.k8s.io/controller-runtime v0.17.6 ) @@ -56,9 +56,9 @@ require ( gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/apiextensions-apiserver v0.29.10 // indirect - k8s.io/client-go v0.29.10 // indirect - k8s.io/component-base v0.29.10 // indirect + k8s.io/apiextensions-apiserver v0.29.11 // indirect + k8s.io/client-go v0.29.11 // indirect + k8s.io/component-base v0.29.11 // indirect k8s.io/klog/v2 v2.120.1 // indirect k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect diff --git a/api/go.sum b/api/go.sum index db1ee32b2..ff3804de5 100644 --- a/api/go.sum +++ b/api/go.sum @@ -179,16 +179,16 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.29.10 h1:Fao3HOxccbGRC1HZtXD+Y41xJhP0tEToVo5W7EEUBm0= -k8s.io/api v0.29.10/go.mod h1:rF0sRh64w1hMNAVGh4YYniSxODyHye3GLmymAbWBDvY= -k8s.io/apiextensions-apiserver v0.29.10 h1:2k2AHrWgs4S+07HrOjEdcyrQ/UqYlvBi6uon1fox1KE= -k8s.io/apiextensions-apiserver v0.29.10/go.mod h1:3rrJC52bW5frHf10N3JvaDpl++hgrzD9Gs6IZpKWMoc= -k8s.io/apimachinery v0.29.10 h1:57OLNqOJUgp5KlRRY3JOBFOTTa5Rt/LVkmKiiN2cvaQ= -k8s.io/apimachinery v0.29.10/go.mod h1:i3FJVwhvSp/6n8Fl4K97PJEP8C+MM+aoDq4+ZJBf70Y= -k8s.io/client-go v0.29.10 h1:hPmG1pmKslRhmCIzVd90sA58B0sJwNwduNgXFWsFqhI= -k8s.io/client-go v0.29.10/go.mod h1:gnMCQiRXGL9K0VtlW8gTkhzptGrHm2BJ4qBbujNemc4= -k8s.io/component-base v0.29.10 h1:YQrQ/bpzGPGqIPEPaBzxjH0/1DJOI+yZPZNbbz7ZCBY= -k8s.io/component-base v0.29.10/go.mod h1:IbwsBob2DnYiAONsSHIuYenchqcDycbHSLHrXshuLgM= +k8s.io/api v0.29.11 h1:6FwDo33f1WX5Yu0RQTX9YAd3wth8Ik0B4SXQKsoQfbk= +k8s.io/api v0.29.11/go.mod h1:3TDAW1OpFbz/Yx5r0W06b6eiAfHEwtH61VYDzpTU4Ng= +k8s.io/apiextensions-apiserver v0.29.11 h1:ytJJQ8EK0GzPa80tnPkfDoBGoNPMwqfaSWwg4FKmbEU= +k8s.io/apiextensions-apiserver v0.29.11/go.mod h1:eqKsza/nErdFNltXoVZmRt9vX99ooDLDMTcIcOG0ueg= +k8s.io/apimachinery v0.29.11 h1:55+6ue9advpA7T0sX2ZJDHCLKuiFfrAAR/39VQN9KEQ= +k8s.io/apimachinery v0.29.11/go.mod h1:i3FJVwhvSp/6n8Fl4K97PJEP8C+MM+aoDq4+ZJBf70Y= +k8s.io/client-go v0.29.11 h1:mBX7Ub0uqpLMwWz3J/AGS/xKOZsjr349qZ1vxVoL1l8= +k8s.io/client-go v0.29.11/go.mod h1:WOEoi/eLg2YEg3/yEd7YK3CNScYkM8AEScQadxUnaTE= +k8s.io/component-base v0.29.11 h1:H3GJIyDNPrscvXGP6wx+9gApcwwmrUd0YtCGp5BcHBA= +k8s.io/component-base v0.29.11/go.mod h1:0qu1WStER4wu5o8RMRndZUWPVcPH1XBy/QQiDcD6lew= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= diff --git a/go.mod b/go.mod index 04da54584..f3cd4282a 100644 --- a/go.mod +++ b/go.mod @@ -19,9 +19,9 @@ require ( github.com/openstack-k8s-operators/nova-operator/api v0.0.0-20221209164002-f9e6b9363961 go.uber.org/zap v1.27.0 gopkg.in/yaml.v3 v3.0.1 - k8s.io/api v0.29.10 - k8s.io/apimachinery v0.29.10 - k8s.io/client-go v0.29.10 + k8s.io/api v0.29.11 + k8s.io/apimachinery v0.29.11 + k8s.io/client-go v0.29.11 k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 sigs.k8s.io/controller-runtime v0.17.6 ) @@ -74,8 +74,8 @@ require ( google.golang.org/protobuf v1.34.1 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - k8s.io/apiextensions-apiserver v0.29.10 // indirect - k8s.io/component-base v0.29.10 // indirect + k8s.io/apiextensions-apiserver v0.29.11 // indirect + k8s.io/component-base v0.29.11 // indirect k8s.io/klog/v2 v2.120.1 // indirect k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect diff --git a/go.sum b/go.sum index 5e3256aa3..2a0f160e3 100644 --- a/go.sum +++ b/go.sum @@ -200,16 +200,16 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.29.10 h1:Fao3HOxccbGRC1HZtXD+Y41xJhP0tEToVo5W7EEUBm0= -k8s.io/api v0.29.10/go.mod h1:rF0sRh64w1hMNAVGh4YYniSxODyHye3GLmymAbWBDvY= -k8s.io/apiextensions-apiserver v0.29.10 h1:2k2AHrWgs4S+07HrOjEdcyrQ/UqYlvBi6uon1fox1KE= -k8s.io/apiextensions-apiserver v0.29.10/go.mod h1:3rrJC52bW5frHf10N3JvaDpl++hgrzD9Gs6IZpKWMoc= -k8s.io/apimachinery v0.29.10 h1:57OLNqOJUgp5KlRRY3JOBFOTTa5Rt/LVkmKiiN2cvaQ= -k8s.io/apimachinery v0.29.10/go.mod h1:i3FJVwhvSp/6n8Fl4K97PJEP8C+MM+aoDq4+ZJBf70Y= -k8s.io/client-go v0.29.10 h1:hPmG1pmKslRhmCIzVd90sA58B0sJwNwduNgXFWsFqhI= -k8s.io/client-go v0.29.10/go.mod h1:gnMCQiRXGL9K0VtlW8gTkhzptGrHm2BJ4qBbujNemc4= -k8s.io/component-base v0.29.10 h1:YQrQ/bpzGPGqIPEPaBzxjH0/1DJOI+yZPZNbbz7ZCBY= -k8s.io/component-base v0.29.10/go.mod h1:IbwsBob2DnYiAONsSHIuYenchqcDycbHSLHrXshuLgM= +k8s.io/api v0.29.11 h1:6FwDo33f1WX5Yu0RQTX9YAd3wth8Ik0B4SXQKsoQfbk= +k8s.io/api v0.29.11/go.mod h1:3TDAW1OpFbz/Yx5r0W06b6eiAfHEwtH61VYDzpTU4Ng= +k8s.io/apiextensions-apiserver v0.29.11 h1:ytJJQ8EK0GzPa80tnPkfDoBGoNPMwqfaSWwg4FKmbEU= +k8s.io/apiextensions-apiserver v0.29.11/go.mod h1:eqKsza/nErdFNltXoVZmRt9vX99ooDLDMTcIcOG0ueg= +k8s.io/apimachinery v0.29.11 h1:55+6ue9advpA7T0sX2ZJDHCLKuiFfrAAR/39VQN9KEQ= +k8s.io/apimachinery v0.29.11/go.mod h1:i3FJVwhvSp/6n8Fl4K97PJEP8C+MM+aoDq4+ZJBf70Y= +k8s.io/client-go v0.29.11 h1:mBX7Ub0uqpLMwWz3J/AGS/xKOZsjr349qZ1vxVoL1l8= +k8s.io/client-go v0.29.11/go.mod h1:WOEoi/eLg2YEg3/yEd7YK3CNScYkM8AEScQadxUnaTE= +k8s.io/component-base v0.29.11 h1:H3GJIyDNPrscvXGP6wx+9gApcwwmrUd0YtCGp5BcHBA= +k8s.io/component-base v0.29.11/go.mod h1:0qu1WStER4wu5o8RMRndZUWPVcPH1XBy/QQiDcD6lew= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= From b67ce72c861af70d3b9baf5ba70091f7d6c526e0 Mon Sep 17 00:00:00 2001 From: Martin Schuppert Date: Tue, 3 Dec 2024 14:45:31 +0100 Subject: [PATCH 4/6] Use conditional assignment for BRANCH Signed-off-by: Martin Schuppert --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0f5a9371b..b112a4bb3 100644 --- a/Makefile +++ b/Makefile @@ -422,7 +422,7 @@ kuttl-test-cleanup: fi CRD_SCHEMA_CHECKER_VERSION ?= release-4.16 -BRANCH=main +BRANCH ?= main PHONY: crd-schema-check crd-schema-check: manifests From a884ca14f8a65993f78345dc0edab1a6772d7701 Mon Sep 17 00:00:00 2001 From: jgilaber Date: Thu, 28 Nov 2024 10:58:05 +0100 Subject: [PATCH 5/6] Use cifmw kuttl job as parent job for reusability In the depends-on PR, a new job definition is introduced that runs kuttl tests following the pattern used in nova-operator. This is done mainly to reuse the job definition for watcher-operator, which has just introduced kuttl testing following the same pattern. This change modifies the nova job to use the same parent. Depends-On: https://github.com/openstack-k8s-operators/ci-framework/pull/2571 --- .zuul.yaml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.zuul.yaml b/.zuul.yaml index a9e3193f2..7f208497a 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -26,7 +26,7 @@ - job: name: nova-operator-kuttl - parent: nova-operator-base + parent: cifmw-multinode-kuttl-operator-target dependencies: ["openstack-meta-content-provider"] roles: - zuul: github.com/openstack-k8s-operators/ci-framework @@ -34,14 +34,12 @@ 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. - pre-run: - - ci/nova-operator-kuttl/playbooks/deploy-deps.yaml - run: - - ci/nova-operator-kuttl/playbooks/run-kuttl.yaml - nodeset: centos-9-medium-crc-extracted-2-39-0-3xl vars: collection_namespace_override: "nova-kuttl-default" + operator_name: nova-operator zuul_log_collection: true + post-run: + - ci/nova-operator-base/playbooks/collect-logs.yaml extra-vars: crc_ci_bootstrap_networking: networks: From 418bd2b753696822d15862bf6711e5747d3278a5 Mon Sep 17 00:00:00 2001 From: jgilaber Date: Fri, 29 Nov 2024 09:23:42 +0100 Subject: [PATCH 6/6] Remove unused job defintion and playbooks/files After the parenting change for the kuttl job, the nova-operator-base job is unused and can be removed. Similarly, the playbooks ported to the ci-framework can be removed. --- .zuul.yaml | 25 ---- ci/nova-operator-base/ansible.cfg | 2 - ci/nova-operator-base/ci_fw_vars.yaml | 18 --- ci/nova-operator-base/inventory.ini | 9 -- .../playbooks/pre-wrapper.yaml | 33 ----- ci/nova-operator-base/playbooks/pre.yaml | 128 ------------------ ci/nova-operator-kuttl/ansible.cfg | 2 - ci/nova-operator-kuttl/inventory.ini | 9 -- .../playbooks/deploy-deps.yaml | 17 --- .../playbooks/run-kuttl.yaml | 25 ---- 10 files changed, 268 deletions(-) delete mode 100644 ci/nova-operator-base/ansible.cfg delete mode 100644 ci/nova-operator-base/ci_fw_vars.yaml delete mode 100644 ci/nova-operator-base/inventory.ini delete mode 100644 ci/nova-operator-base/playbooks/pre-wrapper.yaml delete mode 100644 ci/nova-operator-base/playbooks/pre.yaml delete mode 100644 ci/nova-operator-kuttl/ansible.cfg delete mode 100644 ci/nova-operator-kuttl/inventory.ini delete mode 100644 ci/nova-operator-kuttl/playbooks/deploy-deps.yaml delete mode 100644 ci/nova-operator-kuttl/playbooks/run-kuttl.yaml diff --git a/.zuul.yaml b/.zuul.yaml index 7f208497a..d53ed32e9 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -1,29 +1,4 @@ --- -- job: - name: nova-operator-base - description: | - This is the base job for all nova-operator tests that will deploy - openstack. the base job does not deploy openstack but it does use - the nova-operator-content-provider job to provide a registry with - built operators and installs them on a crc environment. Child jobs - should take this deployed crc and use the installed operators to - deploy openstack and then test it. This job will fetch the job - output directory so child jobs can just add additional logs to that - in there post-playbooks. - parent: cifmw-podified-multinode-edpm-base-crc - abstract: true - attempts: 1 - dependencies: ["openstack-meta-content-provider"] - required-projects: - - github.com/openstack-k8s-operators/ci-framework - - github.com/openstack-k8s-operators/install_yamls - roles: - - zuul: github.com/openstack-k8s-operators/ci-framework - pre-run: - - ci/nova-operator-base/playbooks/pre-wrapper.yaml - post-run: - - ci/nova-operator-base/playbooks/collect-logs.yaml - - job: name: nova-operator-kuttl parent: cifmw-multinode-kuttl-operator-target diff --git a/ci/nova-operator-base/ansible.cfg b/ci/nova-operator-base/ansible.cfg deleted file mode 100644 index 765ca2213..000000000 --- a/ci/nova-operator-base/ansible.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[defaults] -roles_path = /usr/share/ansible/roles:/etc/ansible/roles:../../../ci-framework/roles diff --git a/ci/nova-operator-base/ci_fw_vars.yaml b/ci/nova-operator-base/ci_fw_vars.yaml deleted file mode 100644 index eda16763d..000000000 --- a/ci/nova-operator-base/ci_fw_vars.yaml +++ /dev/null @@ -1,18 +0,0 @@ ---- -ansible_user_dir: "{{ lookup('env', 'HOME') }}" -cifmw_installyamls_repos: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/install_yamls" -cifmw_install_yamls_vars: - STORAGE_CLASS: crc-csi-hostpath-provisioner - BMO_SETUP: false - -cifmw_openshift_user: "kubeadmin" -cifmw_openshift_password: "123456789" -cifmw_openshift_kubeconfig: "{{ ansible_user_dir }}/.crc/machines/crc/kubeconfig" - -cifmw_openshift_setup_skip_internal_registry: true - -# edpm_prepare role vars -cifmw_operator_build_meta_name: "openstack-operator" -cifmw_edpm_prepare_skip_crc_storage_creation: true - -cifmw_rhol_crc_use_installyamls: true diff --git a/ci/nova-operator-base/inventory.ini b/ci/nova-operator-base/inventory.ini deleted file mode 100644 index cb7a1e19f..000000000 --- a/ci/nova-operator-base/inventory.ini +++ /dev/null @@ -1,9 +0,0 @@ -[openshift] -controller ansible_connection=local - -[openshift:vars] -local_install_yamls_basedir="~/repos/install_yamls" -collection_namespace_override="nova-kuttl-default" - -[all:vars] -ansible_user_dir="~/" diff --git a/ci/nova-operator-base/playbooks/pre-wrapper.yaml b/ci/nova-operator-base/playbooks/pre-wrapper.yaml deleted file mode 100644 index f764d4a1b..000000000 --- a/ci/nova-operator-base/playbooks/pre-wrapper.yaml +++ /dev/null @@ -1,33 +0,0 @@ -- name: "Run ci/nova-operator-base/playbooks/pre.yml" - hosts: controller - gather_facts: true - vars: - nova_operator_basedir: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/nova-operator" - ansible_playbook_command: "ansible-playbook -vv" - ansible_playbook_command_suffix: >- - -e @scenarios/centos-9/base.yml - -e @{{nova_operator_basedir}}/ci/nova-operator-base/ci_fw_vars.yaml - {%- if cifmw_extras is defined %} - {%- for extra_vars in cifmw_extras %} - -e "{{ extra_vars }}" - {%- endfor %} - {%- endif %} - -e "@{{ ansible_user_dir }}/ci-framework-data/artifacts/parameters/zuul-params.yml" - ci_framework_playbooks_path: "{{[ ansible_user_dir, - zuul.projects['github.com/openstack-k8s-operators/ci-framework'].src_dir, - 'playbooks'] | ansible.builtin.path_join }}" - pre_playbook: "{{nova_operator_basedir}}/ci/nova-operator-base/playbooks/pre.yaml" - controller_logs_dir: "{{ ansible_user_dir }}/zuul-output/logs/controller" - tasks: - - name: Create log dir - ansible.builtin.file: - path: "{{ controller_logs_dir }}" - state: directory - mode: "0755" - - name: Run pre playbook - ansible.builtin.shell: - executable: /bin/bash - chdir: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/ci-framework" - cmd: >- - {{ansible_playbook_command}} {{ansible_playbook_command_suffix}} {{pre_playbook}} - 2>&1 | tee {{ controller_logs_dir }}/nova-operator-base_pre.log diff --git a/ci/nova-operator-base/playbooks/pre.yaml b/ci/nova-operator-base/playbooks/pre.yaml deleted file mode 100644 index fff98a37c..000000000 --- a/ci/nova-operator-base/playbooks/pre.yaml +++ /dev/null @@ -1,128 +0,0 @@ ---- -- name: Run ci_framework bootstrap playbook - ansible.builtin.import_playbook: >- - {{[ ansible_user_dir, - zuul.projects["github.com/openstack-k8s-operators/ci-framework"].src_dir, - "playbooks/01-bootstrap.yml"] | ansible.builtin.path_join}} - -- hosts: "{{ cifmw_target_host | default('localhost') }}" - name: install dev tools - tasks: - - name: Download install_yamls deps - ansible.builtin.include_role: - name: 'install_yamls_makes' - tasks_from: 'make_download_tools' - -- name: Run ci_framework infra playbook - ansible.builtin.import_playbook: >- - {{[ ansible_user_dir, - zuul.projects["github.com/openstack-k8s-operators/ci-framework"].src_dir, - "playbooks/02-infra.yml"] | ansible.builtin.path_join}} - -- name: Build dataset hook - hosts: localhost - gather_facts: false - connection: local - tasks: - - name: Load parameters - ansible.builtin.include_vars: - dir: "{{ item }}" - loop: - - "{{ cifmw_basedir }}/artifacts/parameters" - - "/etc/ci/env" - loop_control: - label: "{{ item }}" - - - name: Check we have some compute in inventory - ansible.builtin.set_fact: - has_compute: >- - {% set ns = namespace(found=false) -%} - {% for host in hostvars.keys() -%} - {% if host is match('^compute.*') -%} - {% set ns.found = true -%} - {% endif -%} - {% endfor -%} - {{ ns.found }} - - - name: Ensure that the isolated net was configured for crc - ansible.builtin.assert: - that: - - crc_ci_bootstrap_networks_out is defined - - "'crc' in crc_ci_bootstrap_networks_out" - - "'default' in crc_ci_bootstrap_networks_out['crc']" - - - name: Ensure we have needed bits for compute when needed - when: - - has_compute | bool - ansible.builtin.assert: - that: - - "'compute' in crc_ci_bootstrap_networks_out" - - "'default' in crc_ci_bootstrap_networks_out['compute']" - - - name: Set facts for further usage within the framework - ansible.builtin.set_fact: - cifmw_edpm_prepare_extra_vars: - NNCP_INTERFACE: "{{ crc_ci_bootstrap_networks_out.crc.default.iface }}" - NETWORK_MTU: "{{ crc_ci_bootstrap_networks_out.crc.default.mtu }}" - -- hosts: "{{ cifmw_target_host | default('localhost') }}" - name: Deploy Openstack Operators - tasks: - - name: Set install_yamls Makefile environment variables - vars: - operators_build_output: "{{ (cifmw_operator_build_output | default({'operators':{}})).operators }}" - ansible.builtin.set_fact: - cifmw_edpm_prepare_common_env: >- - {{ - cifmw_install_yamls_environment | - combine({'PATH': cifmw_path}) | - combine(cifmw_edpm_prepare_extra_vars | default({})) - }} - cifmw_edpm_prepare_make_openstack_env: | - OPENSTACK_IMG: "{{ cifmw_operator_build_output.operators['openstack-operator']['image_catalog'] | default(omit) }}" - OPENSTACK_BUNDLE_IMG: "{{ cifmw_operator_build_output.operators['openstack-operator']['image_bundle'] | default(omit) }}" - NOVA_IMG: "{{ cifmw_operator_build_output.operators['nova-operator']['image_catalog'] | default(omit) }}" - cifmw_edpm_prepare_operators_build_output: "{{ operators_build_output }}" - - name: Deploy openstack Operators - block: - - name: detect if openstack operator is installed - environment: - KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}" - PATH: "{{ cifmw_path | default(ansible_env.PATH) }}" - ansible.builtin.command: - cmd: "oc get sub --ignore-not-found=true -n openstack-operators -o name openstack-operator" - ignore_errors: true - register: openstack_operator_subscription - - name: Install openstack operator - when: openstack_operator_subscription.stdout == "" - vars: - make_openstack_env: "{{ cifmw_edpm_prepare_common_env | - combine(cifmw_edpm_prepare_make_openstack_env | from_yaml)}}" - make_openstack_dryrun: "{{ cifmw_edpm_prepare_dry_run }}" - ansible.builtin.include_role: - name: 'install_yamls_makes' - tasks_from: 'make_openstack' - - name: Wait for OpenStack subscription creation - when: openstack_operator_subscription.stdout == "" - environment: - KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}" - PATH: "{{ cifmw_path | default(ansible_env.PATH) }}" - ansible.builtin.command: - cmd: >- - oc get sub openstack-operator - --namespace=openstack-operators - -o=jsonpath='{.status.installplan.name}' - register: cifmw_edpm_prepare_wait_installplan_out - until: cifmw_edpm_prepare_wait_installplan_out.rc == 0 and cifmw_edpm_prepare_wait_installplan_out.stdout != "" - retries: 30 - delay: 10 - - name: Wait for OpenStack operator to get installed - when: openstack_operator_subscription.stdout == "" - environment: - KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}" - PATH: "{{ cifmw_path | default(ansible_env.PATH) }}" - ansible.builtin.command: - cmd: >- - oc wait InstallPlan {{ cifmw_edpm_prepare_wait_installplan_out.stdout }} - --namespace=openstack-operators - --for=jsonpath='{.status.phase}'=Complete --timeout=20m diff --git a/ci/nova-operator-kuttl/ansible.cfg b/ci/nova-operator-kuttl/ansible.cfg deleted file mode 100644 index 765ca2213..000000000 --- a/ci/nova-operator-kuttl/ansible.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[defaults] -roles_path = /usr/share/ansible/roles:/etc/ansible/roles:../../../ci-framework/roles diff --git a/ci/nova-operator-kuttl/inventory.ini b/ci/nova-operator-kuttl/inventory.ini deleted file mode 100644 index 390656c8f..000000000 --- a/ci/nova-operator-kuttl/inventory.ini +++ /dev/null @@ -1,9 +0,0 @@ -[openshift] -controller ansible_connection=local - -[openshift:vars] -local_nova_operator_basedir= "~/repos/nova-operator" -local_log_dir= "/tmp/nova-operator-kuttl/logs" - -[all:vars] -ansible_user_dir="~/" diff --git a/ci/nova-operator-kuttl/playbooks/deploy-deps.yaml b/ci/nova-operator-kuttl/playbooks/deploy-deps.yaml deleted file mode 100644 index b64661026..000000000 --- a/ci/nova-operator-kuttl/playbooks/deploy-deps.yaml +++ /dev/null @@ -1,17 +0,0 @@ ---- -- hosts: controller - vars: - nova_operator_basedir: "{{local_nova_operator_basedir | default(ansible_user_dir + '/src/github.com/openstack-k8s-operators/nova-operator')}}" - tasks: - - name: install kuttl test_suite dependencies - environment: - KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}" - PATH: "{{ cifmw_path | default(ansible_env.PATH) }}" - ansible.builtin.command: - cmd: make kuttl-test-prep - chdir: "{{nova_operator_basedir}}" - register: result - until: result.rc == 0 - retries: 3 - delay: 10 - changed_when: true diff --git a/ci/nova-operator-kuttl/playbooks/run-kuttl.yaml b/ci/nova-operator-kuttl/playbooks/run-kuttl.yaml deleted file mode 100644 index 09208bb17..000000000 --- a/ci/nova-operator-kuttl/playbooks/run-kuttl.yaml +++ /dev/null @@ -1,25 +0,0 @@ -- hosts: controller - vars: - nova_operator_basedir: "{{local_nova_operator_basedir | default(ansible_user_dir + '/src/github.com/openstack-k8s-operators/nova-operator')}}" - kuttl_log_dir: "{{local_log_dir | default(ansible_user_dir + '/zuul-output/logs/controller')}}" - tasks: - - name: install kuttl test_suite dependencies - environment: - KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}" - PATH: "{{ cifmw_path | default(ansible_env.PATH) }}" - ansible.builtin.command: - cmd: make kuttl-test-run - chdir: "{{nova_operator_basedir}}" - changed_when: true - register: kuttl_test_run - - name: Create log dir - ansible.builtin.file: - path: "{{kuttl_log_dir}}" - state: directory - mode: "0755" - recurse: yes - - name: save output to file - ansible.builtin.copy: - content: "{{kuttl_test_run.stdout}}" - dest: "{{kuttl_log_dir}}/kuttl-test-run.out" - when: kuttl_test_run.stdout is defined