From fd8b70e0fc9db195c97ae5ca7a8d59737ed6197f Mon Sep 17 00:00:00 2001 From: Martin Schuppert Date: Mon, 17 Jun 2024 11:54:20 +0200 Subject: [PATCH] update finalzier to CRD doc Depends-On: https://github.com/openstack-k8s-operators/lib-common/pull/519 Depends-On: https://github.com/openstack-k8s-operators/mariadb-operator/pull/231 Signed-off-by: Martin Schuppert --- api/go.mod | 2 +- api/go.sum | 4 ++-- go.mod | 4 +++- go.sum | 8 +++---- .../placementapi_controller_test.go | 22 +++++++++---------- .../common/assert_sample_deployment.yaml | 2 +- .../common/errors_cleanup_placement.yaml | 2 +- .../tests/placement_deploy_tls/03-assert.yaml | 2 +- .../tests/placement_scale/03-assert.yaml | 2 +- .../tests/placement_scale/04-assert.yaml | 2 +- .../tests/placement_scale/05-assert.yaml | 2 +- 11 files changed, 27 insertions(+), 25 deletions(-) diff --git a/api/go.mod b/api/go.mod index 0cdb232c..b0f0a849 100644 --- a/api/go.mod +++ b/api/go.mod @@ -3,7 +3,7 @@ module github.com/openstack-k8s-operators/placement-operator/api go 1.20 require ( - github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20240615134235-24529fcff658 + github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20240618142732-ec81334ac10d k8s.io/api v0.28.11 k8s.io/apimachinery v0.28.11 sigs.k8s.io/controller-runtime v0.16.6 diff --git a/api/go.sum b/api/go.sum index f1b4f184..179a1078 100644 --- a/api/go.sum +++ b/api/go.sum @@ -65,8 +65,8 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/onsi/ginkgo/v2 v2.19.0 h1:9Cnnf7UHo57Hy3k6/m5k3dRfGTMXGvxhHFvkDTCTpvA= github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk= -github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20240615134235-24529fcff658 h1:h10bPourbXsIN7p5M//SUly/UzWfEp+d5tloBnyDDMI= -github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20240615134235-24529fcff658/go.mod h1:k9KuWN2LBtLbKHgcyh/0lrwk3Kr0cOAhiR3hi/mrwOQ= +github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20240618142732-ec81334ac10d h1:t1Lvt1WGp/WbkdU5R7nsc0NtMAvfd0K1nlNYLprHhbQ= +github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20240618142732-ec81334ac10d/go.mod h1:k9KuWN2LBtLbKHgcyh/0lrwk3Kr0cOAhiR3hi/mrwOQ= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= diff --git a/go.mod b/go.mod index 3d6c65b0..548502f7 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/onsi/ginkgo/v2 v2.19.0 github.com/onsi/gomega v1.33.1 github.com/openstack-k8s-operators/keystone-operator/api v0.3.1-0.20240617061212-21a80bc3d1fa - github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20240615134235-24529fcff658 + github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20240618142732-ec81334ac10d github.com/openstack-k8s-operators/lib-common/modules/test v0.3.1-0.20240615134235-24529fcff658 github.com/openstack-k8s-operators/mariadb-operator/api v0.3.1-0.20240617061457-85af496b1f8d github.com/openstack-k8s-operators/placement-operator/api v0.3.1-0.20240216174613-3d349f26e681 @@ -86,3 +86,5 @@ replace github.com/openstack-k8s-operators/placement-operator/api => ./api // mschuppert: map to latest commit from release-4.13 tag // must consistent within modules and service operators replace github.com/openshift/api => github.com/openshift/api v0.0.0-20230414143018-3367bc7e6ac7 //allow-merging + +replace github.com/openstack-k8s-operators/mariadb-operator/api => github.com/stuggi/mariadb-operator/api v0.0.0-20240618071652-676683c1fbba diff --git a/go.sum b/go.sum index 0ce1f8ca..8e35768d 100644 --- a/go.sum +++ b/go.sum @@ -76,14 +76,12 @@ github.com/openshift/api v0.0.0-20230414143018-3367bc7e6ac7 h1:rncLxJBpFGqBztyxC github.com/openshift/api v0.0.0-20230414143018-3367bc7e6ac7/go.mod h1:ctXNyWanKEjGj8sss1KjjHQ3ENKFm33FFnS5BKaIPh4= github.com/openstack-k8s-operators/keystone-operator/api v0.3.1-0.20240617061212-21a80bc3d1fa h1:Zq8sd+K35D7jawVJzuEATsOTESdMT1Wu6t9gdGK8sdA= github.com/openstack-k8s-operators/keystone-operator/api v0.3.1-0.20240617061212-21a80bc3d1fa/go.mod h1:0IMSIVB7kMArAHQW+fQcaWTN4xDURGaEyLT+ro2Q05k= -github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20240615134235-24529fcff658 h1:h10bPourbXsIN7p5M//SUly/UzWfEp+d5tloBnyDDMI= -github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20240615134235-24529fcff658/go.mod h1:k9KuWN2LBtLbKHgcyh/0lrwk3Kr0cOAhiR3hi/mrwOQ= +github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20240618142732-ec81334ac10d h1:t1Lvt1WGp/WbkdU5R7nsc0NtMAvfd0K1nlNYLprHhbQ= +github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20240618142732-ec81334ac10d/go.mod h1:k9KuWN2LBtLbKHgcyh/0lrwk3Kr0cOAhiR3hi/mrwOQ= github.com/openstack-k8s-operators/lib-common/modules/openstack v0.3.1-0.20240615134235-24529fcff658 h1:Vb2WhryohIhyeG55z3HDG3R5hk4ipvAYRxAOUgYrOlI= github.com/openstack-k8s-operators/lib-common/modules/openstack v0.3.1-0.20240615134235-24529fcff658/go.mod h1:zuPcZ5Kopr15AdfxvA0xqKIIGCZ0XbSe/0VHNKuvbEE= github.com/openstack-k8s-operators/lib-common/modules/test v0.3.1-0.20240615134235-24529fcff658 h1:E3v5us2zv+9bRj+8t9Lk0+QpC6t1KSgVsDuzv+7RiMQ= github.com/openstack-k8s-operators/lib-common/modules/test v0.3.1-0.20240615134235-24529fcff658/go.mod h1:0h76CxD9g0z2Hk7fGFOZcjnzT1tQQ/yRNv3OXng+S/A= -github.com/openstack-k8s-operators/mariadb-operator/api v0.3.1-0.20240617061457-85af496b1f8d h1:9x6/YC/UzmT2dQ1ulHSFlK09cGQf3rxo0Ff5ki62/KE= -github.com/openstack-k8s-operators/mariadb-operator/api v0.3.1-0.20240617061457-85af496b1f8d/go.mod h1:C9Y3qa7mcFdqcWLpfnB61ZxI56Lu1PWm90er8tdAyu8= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -102,6 +100,8 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stuggi/mariadb-operator/api v0.0.0-20240618071652-676683c1fbba h1:BQzhBLcwRPY1NRwDpVFJfPzjT2jNNvFyJQXCLBkwgC4= +github.com/stuggi/mariadb-operator/api v0.0.0-20240618071652-676683c1fbba/go.mod h1:61AJvbfu45ZofuPO5GCb8akTxXQJD8XEv7TBYDB0/2o= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= diff --git a/tests/functional/placementapi_controller_test.go b/tests/functional/placementapi_controller_test.go index cde2d01d..8d102328 100644 --- a/tests/functional/placementapi_controller_test.go +++ b/tests/functional/placementapi_controller_test.go @@ -73,7 +73,7 @@ var _ = Describe("PlacementAPI controller", func() { // it to run Eventually(func() []string { return GetPlacementAPI(names.PlacementAPIName).Finalizers - }, timeout, interval).Should(ContainElement("PlacementAPI")) + }, timeout, interval).Should(ContainElement("openstack.org/placementapi")) }) It("should not create a config map", func() { @@ -733,26 +733,26 @@ var _ = Describe("PlacementAPI controller", func() { It("removes the finalizers when deleted", func() { placement := GetPlacementAPI(names.PlacementAPIName) - Expect(placement.Finalizers).To(ContainElement("PlacementAPI")) + Expect(placement.Finalizers).To(ContainElement("openstack.org/placementapi")) keystoneService := keystone.GetKeystoneService(names.KeystoneServiceName) - Expect(keystoneService.Finalizers).To(ContainElement("PlacementAPI")) + Expect(keystoneService.Finalizers).To(ContainElement("openstack.org/placementapi")) keystoneEndpoint := keystone.GetKeystoneService(names.KeystoneEndpointName) - Expect(keystoneEndpoint.Finalizers).To(ContainElement("PlacementAPI")) + Expect(keystoneEndpoint.Finalizers).To(ContainElement("openstack.org/placementapi")) db := mariadb.GetMariaDBDatabase(names.MariaDBDatabaseName) - Expect(db.Finalizers).To(ContainElement("PlacementAPI")) + Expect(db.Finalizers).To(ContainElement("openstack.org/placementapi")) acc := mariadb.GetMariaDBAccount(names.MariaDBAccount) - Expect(acc.Finalizers).To(ContainElement("PlacementAPI")) + Expect(acc.Finalizers).To(ContainElement("openstack.org/placementapi")) th.DeleteInstance(GetPlacementAPI(names.PlacementAPIName)) keystoneService = keystone.GetKeystoneService(names.KeystoneServiceName) - Expect(keystoneService.Finalizers).NotTo(ContainElement("PlacementAPI")) + Expect(keystoneService.Finalizers).NotTo(ContainElement("openstack.org/placementapi")) keystoneEndpoint = keystone.GetKeystoneService(names.KeystoneEndpointName) - Expect(keystoneEndpoint.Finalizers).NotTo(ContainElement("PlacementAPI")) + Expect(keystoneEndpoint.Finalizers).NotTo(ContainElement("openstack.org/placementapi")) db = mariadb.GetMariaDBDatabase(names.MariaDBDatabaseName) - Expect(db.Finalizers).NotTo(ContainElement("PlacementAPI")) + Expect(db.Finalizers).NotTo(ContainElement("openstack.org/placementapi")) acc = mariadb.GetMariaDBAccount(names.MariaDBAccount) - Expect(acc.Finalizers).NotTo(ContainElement("PlacementAPI")) + Expect(acc.Finalizers).NotTo(ContainElement("openstack.org/placementapi")) }) It("updates the deployment if configuration changes", func() { @@ -884,7 +884,7 @@ var _ = Describe("PlacementAPI controller", func() { "Placement", names.PlacementAPIName.Namespace, placement.DatabaseName, - "PlacementAPI", + "openstack.org/placementapi", mariadb, timeout, interval, ) }, diff --git a/tests/kuttl/common/assert_sample_deployment.yaml b/tests/kuttl/common/assert_sample_deployment.yaml index 7a2dff8c..b89f785a 100644 --- a/tests/kuttl/common/assert_sample_deployment.yaml +++ b/tests/kuttl/common/assert_sample_deployment.yaml @@ -2,7 +2,7 @@ apiVersion: placement.openstack.org/v1beta1 kind: PlacementAPI metadata: finalizers: - - PlacementAPI + - openstack.org/placementapi name: placement spec: customServiceConfig: | diff --git a/tests/kuttl/common/errors_cleanup_placement.yaml b/tests/kuttl/common/errors_cleanup_placement.yaml index 7679e247..4e0a769b 100644 --- a/tests/kuttl/common/errors_cleanup_placement.yaml +++ b/tests/kuttl/common/errors_cleanup_placement.yaml @@ -10,7 +10,7 @@ apiVersion: placement.openstack.org/v1beta1 kind: PlacementAPI metadata: finalizers: - - PlacementAPI + - openstack.org/placementapi name: placement --- apiVersion: apps/v1 diff --git a/tests/kuttl/tests/placement_deploy_tls/03-assert.yaml b/tests/kuttl/tests/placement_deploy_tls/03-assert.yaml index 47fee689..b88f0c97 100644 --- a/tests/kuttl/tests/placement_deploy_tls/03-assert.yaml +++ b/tests/kuttl/tests/placement_deploy_tls/03-assert.yaml @@ -2,7 +2,7 @@ apiVersion: placement.openstack.org/v1beta1 kind: PlacementAPI metadata: finalizers: - - PlacementAPI + - openstack.org/placementapi name: placement spec: customServiceConfig: | diff --git a/tests/kuttl/tests/placement_scale/03-assert.yaml b/tests/kuttl/tests/placement_scale/03-assert.yaml index 1ddd91c0..c3534b70 100644 --- a/tests/kuttl/tests/placement_scale/03-assert.yaml +++ b/tests/kuttl/tests/placement_scale/03-assert.yaml @@ -9,7 +9,7 @@ apiVersion: placement.openstack.org/v1beta1 kind: PlacementAPI metadata: finalizers: - - PlacementAPI + - openstack.org/placementapi name: placement spec: replicas: 3 diff --git a/tests/kuttl/tests/placement_scale/04-assert.yaml b/tests/kuttl/tests/placement_scale/04-assert.yaml index d1ac9fc6..cfed8052 100644 --- a/tests/kuttl/tests/placement_scale/04-assert.yaml +++ b/tests/kuttl/tests/placement_scale/04-assert.yaml @@ -9,7 +9,7 @@ apiVersion: placement.openstack.org/v1beta1 kind: PlacementAPI metadata: finalizers: - - PlacementAPI + - openstack.org/placementapi name: placement spec: replicas: 1 diff --git a/tests/kuttl/tests/placement_scale/05-assert.yaml b/tests/kuttl/tests/placement_scale/05-assert.yaml index 7b9ad5c4..209ec464 100644 --- a/tests/kuttl/tests/placement_scale/05-assert.yaml +++ b/tests/kuttl/tests/placement_scale/05-assert.yaml @@ -10,7 +10,7 @@ apiVersion: placement.openstack.org/v1beta1 kind: PlacementAPI metadata: finalizers: - - PlacementAPI + - openstack.org/placementapi name: placement spec: replicas: 0