Skip to content

Commit

Permalink
[envtest]Use keystone helpers from keystone-operator
Browse files Browse the repository at this point in the history
This was necessary to remove a dependency cycle from lib-common
  • Loading branch information
gibizer committed Sep 25, 2023
1 parent 4628ad7 commit e0d0bfe
Show file tree
Hide file tree
Showing 9 changed files with 90 additions and 87 deletions.
3 changes: 1 addition & 2 deletions api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/openstack-k8s-operators/nova-operator/api
go 1.19

require (
github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20230919113507-d74c2f31d216
github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20230925103424-7dcb605ea0bb
k8s.io/api v0.26.9
k8s.io/apimachinery v0.26.9
k8s.io/utils v0.0.0-20230726121419-3b25d923346b
Expand Down Expand Up @@ -36,7 +36,6 @@ require (
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/onsi/ginkgo/v2 v2.12.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
Expand Down
5 changes: 2 additions & 3 deletions api/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,9 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8m
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/onsi/ginkgo/v2 v2.12.1 h1:uHNEO1RP2SpuZApSkel9nEh1/Mu+hmQe7Q+Pepg5OYA=
github.com/onsi/ginkgo/v2 v2.12.1/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o=
github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20230919113507-d74c2f31d216 h1:arYbQA6bLyXJkHm+6M6gPc4YpWMFjs5qkG16Yii4UDo=
github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20230919113507-d74c2f31d216/go.mod h1:Ge7Yf6AUmjEvJK9AIW2bT5udLzBIcK59b1QxqymncaQ=
github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20230925103424-7dcb605ea0bb h1:MRd/OrTTZeU/KXAzlIH003wPLmjZ4PHaQ7HisJC9hGY=
github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20230925103424-7dcb605ea0bb/go.mod h1:kZS5rqVWBZeCyYor2PeQB9IEZ19mGaeL/to3x8F9OJg=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
Expand Down
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ require (
github.com/onsi/ginkgo/v2 v2.12.1
github.com/onsi/gomega v1.27.10
github.com/openstack-k8s-operators/infra-operator/apis v0.1.1-0.20230920125017-2c76cd203b44
github.com/openstack-k8s-operators/keystone-operator/api v0.1.1-0.20230920085319-92ae0260bbf3
github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20230919113507-d74c2f31d216
github.com/openstack-k8s-operators/lib-common/modules/database v0.1.1-0.20230919113507-d74c2f31d216
github.com/openstack-k8s-operators/lib-common/modules/test v0.1.2-0.20230919113507-d74c2f31d216
github.com/openstack-k8s-operators/keystone-operator/api v0.1.1-0.20230925115904-772bbf00ffcf
github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20230925103424-7dcb605ea0bb
github.com/openstack-k8s-operators/lib-common/modules/database v0.1.1-0.20230925103424-7dcb605ea0bb
github.com/openstack-k8s-operators/lib-common/modules/test v0.1.2-0.20230925103424-7dcb605ea0bb
github.com/openstack-k8s-operators/mariadb-operator/api v0.1.1-0.20230918111825-8999b3b2dc3c
github.com/openstack-k8s-operators/nova-operator/api v0.0.0-20221209164002-f9e6b9363961
go.uber.org/zap v1.26.0
Expand Down Expand Up @@ -54,7 +54,7 @@ require (
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/openshift/api v3.9.0+incompatible // indirect
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.1.1-0.20230919113507-d74c2f31d216 // indirect
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.1.1-0.20230925103424-7dcb605ea0bb // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
Expand Down
20 changes: 10 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -238,16 +238,16 @@ 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/infra-operator/apis v0.1.1-0.20230920125017-2c76cd203b44 h1:W2HZy+uk5fnVwvw3+/Jd/k7sNiVXCOd8SiV0dMvmjys=
github.com/openstack-k8s-operators/infra-operator/apis v0.1.1-0.20230920125017-2c76cd203b44/go.mod h1:fOJ95wMSymtfoellY/TFKcrzW6bu/nTCTzEnFEgCGCc=
github.com/openstack-k8s-operators/keystone-operator/api v0.1.1-0.20230920085319-92ae0260bbf3 h1:6VCz/ZBTJEQJTx4+z8UxLv3WITa4Bgx5CSP237wJ5xM=
github.com/openstack-k8s-operators/keystone-operator/api v0.1.1-0.20230920085319-92ae0260bbf3/go.mod h1:ta6w/29i4WuWkQp6I4cOLwMGQ5/vJI0y8Em7u+M34jo=
github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20230919113507-d74c2f31d216 h1:arYbQA6bLyXJkHm+6M6gPc4YpWMFjs5qkG16Yii4UDo=
github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20230919113507-d74c2f31d216/go.mod h1:Ge7Yf6AUmjEvJK9AIW2bT5udLzBIcK59b1QxqymncaQ=
github.com/openstack-k8s-operators/lib-common/modules/database v0.1.1-0.20230919113507-d74c2f31d216 h1:PykqfrahtBUbhIuM0IDRyrtVCOzy7jdEZz3yVEnwpp0=
github.com/openstack-k8s-operators/lib-common/modules/database v0.1.1-0.20230919113507-d74c2f31d216/go.mod h1:gdmDHoWrDtq8gfJHl20rQwe9vfzJJkY+KnvM6aD9+08=
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.1.1-0.20230919113507-d74c2f31d216 h1:h76faqi4WAXBs3D2B0GLUdlCjS0dh78wRL0d5RZUwhk=
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.1.1-0.20230919113507-d74c2f31d216/go.mod h1:GHi64tgyC75/vuT8Crda0yN5iCIYiSyS4bpzYJjX7MA=
github.com/openstack-k8s-operators/lib-common/modules/test v0.1.2-0.20230919113507-d74c2f31d216 h1:QyzzvG8iaDFwx6Lo44dCyf2tRtgk0sqniXjgJpiW32g=
github.com/openstack-k8s-operators/lib-common/modules/test v0.1.2-0.20230919113507-d74c2f31d216/go.mod h1:RfLOPJbmPzPZ4XHwwDc2tFbbw5zxZL15JFGwb5c6VaU=
github.com/openstack-k8s-operators/keystone-operator/api v0.1.1-0.20230925115904-772bbf00ffcf h1:inyT3plUxpdFef3iZawwMK08uou1n+RSVEhyAQd7LFM=
github.com/openstack-k8s-operators/keystone-operator/api v0.1.1-0.20230925115904-772bbf00ffcf/go.mod h1:Zyp4nHS/JggPqlsMNM8WZN546oYINvGVlHA1NivE3sU=
github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20230925103424-7dcb605ea0bb h1:MRd/OrTTZeU/KXAzlIH003wPLmjZ4PHaQ7HisJC9hGY=
github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20230925103424-7dcb605ea0bb/go.mod h1:kZS5rqVWBZeCyYor2PeQB9IEZ19mGaeL/to3x8F9OJg=
github.com/openstack-k8s-operators/lib-common/modules/database v0.1.1-0.20230925103424-7dcb605ea0bb h1:bGhIosetHt4+Kle0+0Vpa204v19u3k0p5Ox7CYD7jfw=
github.com/openstack-k8s-operators/lib-common/modules/database v0.1.1-0.20230925103424-7dcb605ea0bb/go.mod h1:RroLfB6Wstc+z7JVJY9o+6YPu+wBIzTAAfMpwhv7pDI=
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.1.1-0.20230925103424-7dcb605ea0bb h1:DKxySUUtfA8hU1PpXgHbAA+kaa55zdKPlxSFOnvD898=
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.1.1-0.20230925103424-7dcb605ea0bb/go.mod h1:+iJZo5alCeOGD/524hWWdlINA6zqY+MjfWT7cDcbvBE=
github.com/openstack-k8s-operators/lib-common/modules/test v0.1.2-0.20230925103424-7dcb605ea0bb h1:djVcLDXr+SL397W2meEiACDMOZNXciEc4ypLDnZ75wU=
github.com/openstack-k8s-operators/lib-common/modules/test v0.1.2-0.20230925103424-7dcb605ea0bb/go.mod h1:HtR62cEJ+x0WlcvNi/nfjhZ+UssC1zfxRA63qnVbxp4=
github.com/openstack-k8s-operators/mariadb-operator/api v0.1.1-0.20230918111825-8999b3b2dc3c h1:9R8T1WRwuPS5KMfsQWxAMSGPuJrGMJ7bODKK9dirhHA=
github.com/openstack-k8s-operators/mariadb-operator/api v0.1.1-0.20230918111825-8999b3b2dc3c/go.mod h1:xXHF/R/L0XamRHR/UkzlgzSTocBQ6GSQ2U16Q9Mf/bA=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
Expand Down
62 changes: 31 additions & 31 deletions test/functional/nova_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ var _ = Describe("Nova controller", func() {
},
),
)
DeferCleanup(th.DeleteKeystoneAPI, th.CreateKeystoneAPI(novaNames.NovaName.Namespace))
DeferCleanup(keystone.DeleteKeystoneAPI, keystone.CreateKeystoneAPI(novaNames.NovaName.Namespace))

DeferCleanup(th.DeleteInstance, CreateNovaWithCell0(novaNames.NovaName))
})
Expand Down Expand Up @@ -90,7 +90,7 @@ var _ = Describe("Nova controller", func() {
},
),
)
DeferCleanup(th.DeleteKeystoneAPI, th.CreateKeystoneAPI(novaNames.NovaName.Namespace))
DeferCleanup(keystone.DeleteKeystoneAPI, keystone.CreateKeystoneAPI(novaNames.NovaName.Namespace))

DeferCleanup(th.DeleteInstance, CreateNovaWithCell0(novaNames.NovaName))
})
Expand Down Expand Up @@ -138,11 +138,11 @@ var _ = Describe("Nova controller", func() {

It("registers nova service to keystone", func() {
// assert that the KeystoneService for nova is created
th.GetKeystoneService(novaNames.KeystoneServiceName)
keystone.GetKeystoneService(novaNames.KeystoneServiceName)
// and simulate that it becomes ready i.e. the keystone-operator
// did its job and registered the nova service
th.SimulateKeystoneServiceReady(novaNames.KeystoneServiceName)
keystone := th.GetKeystoneService(novaNames.KeystoneServiceName)
keystone.SimulateKeystoneServiceReady(novaNames.KeystoneServiceName)
keystone := keystone.GetKeystoneService(novaNames.KeystoneServiceName)
Expect(keystone.Status.Conditions).ToNot(BeNil())

th.ExpectCondition(
Expand All @@ -154,7 +154,7 @@ var _ = Describe("Nova controller", func() {
})

It("creates nova_api DB", func() {
th.SimulateKeystoneServiceReady(novaNames.KeystoneServiceName)
keystone.SimulateKeystoneServiceReady(novaNames.KeystoneServiceName)
th.ExpectCondition(
novaNames.NovaName,
ConditionGetterFunc(NovaConditionGetter),
Expand All @@ -173,7 +173,7 @@ var _ = Describe("Nova controller", func() {
})

It("creates nova-api MQ", func() {
th.SimulateKeystoneServiceReady(novaNames.KeystoneServiceName)
keystone.SimulateKeystoneServiceReady(novaNames.KeystoneServiceName)
th.ExpectCondition(
novaNames.NovaName,
ConditionGetterFunc(NovaConditionGetter),
Expand All @@ -192,7 +192,7 @@ var _ = Describe("Nova controller", func() {
})

It("creates nova_cell0 DB", func() {
th.SimulateKeystoneServiceReady(novaNames.KeystoneServiceName)
keystone.SimulateKeystoneServiceReady(novaNames.KeystoneServiceName)
th.ExpectCondition(
novaNames.NovaName,
ConditionGetterFunc(NovaConditionGetter),
Expand All @@ -211,7 +211,7 @@ var _ = Describe("Nova controller", func() {
})

It("creates cell0 NovaCell", func() {
th.SimulateKeystoneServiceReady(novaNames.KeystoneServiceName)
keystone.SimulateKeystoneServiceReady(novaNames.KeystoneServiceName)
th.SimulateMariaDBDatabaseCompleted(novaNames.APIMariaDBDatabaseName)
th.SimulateMariaDBDatabaseCompleted(cell0.MariaDBDatabaseName)
th.SimulateTransportURLReady(cell0.TransportURLName)
Expand Down Expand Up @@ -316,7 +316,7 @@ var _ = Describe("Nova controller", func() {
})

It("creates an internal Secret for the top level services", func() {
th.SimulateKeystoneServiceReady(novaNames.KeystoneServiceName)
keystone.SimulateKeystoneServiceReady(novaNames.KeystoneServiceName)
th.SimulateMariaDBDatabaseCompleted(novaNames.APIMariaDBDatabaseName)
th.SimulateMariaDBDatabaseCompleted(cell0.MariaDBDatabaseName)
th.SimulateTransportURLReady(cell0.TransportURLName)
Expand All @@ -343,7 +343,7 @@ var _ = Describe("Nova controller", func() {
})

It("creates NovaAPI", func() {
th.SimulateKeystoneServiceReady(novaNames.KeystoneServiceName)
keystone.SimulateKeystoneServiceReady(novaNames.KeystoneServiceName)
th.SimulateMariaDBDatabaseCompleted(novaNames.APIMariaDBDatabaseName)
th.SimulateMariaDBDatabaseCompleted(cell0.MariaDBDatabaseName)
th.SimulateTransportURLReady(cell0.TransportURLName)
Expand All @@ -359,7 +359,7 @@ var _ = Describe("Nova controller", func() {
Expect(api.Spec.Secret).To(Equal(novaNames.InternalTopLevelSecretName.Name))

th.SimulateStatefulSetReplicaReady(novaNames.APIDeploymentName)
th.SimulateKeystoneEndpointReady(novaNames.APIKeystoneEndpointName)
keystone.SimulateKeystoneEndpointReady(novaNames.APIKeystoneEndpointName)
th.ExpectCondition(
novaNames.APIName,
ConditionGetterFunc(NovaAPIConditionGetter),
Expand All @@ -382,15 +382,15 @@ var _ = Describe("Nova controller", func() {
})

It("creates NovaScheduler", func() {
th.SimulateKeystoneServiceReady(novaNames.KeystoneServiceName)
keystone.SimulateKeystoneServiceReady(novaNames.KeystoneServiceName)
th.SimulateMariaDBDatabaseCompleted(novaNames.APIMariaDBDatabaseName)
th.SimulateMariaDBDatabaseCompleted(cell0.MariaDBDatabaseName)
th.SimulateTransportURLReady(cell0.TransportURLName)
th.SimulateJobSuccess(cell0.DBSyncJobName)
th.SimulateStatefulSetReplicaReady(cell0.ConductorStatefulSetName)
th.SimulateJobSuccess(cell0.CellMappingJobName)
th.SimulateStatefulSetReplicaReady(novaNames.APIDeploymentName)
th.SimulateKeystoneEndpointReady(novaNames.APIKeystoneEndpointName)
keystone.SimulateKeystoneEndpointReady(novaNames.APIKeystoneEndpointName)
th.SimulateStatefulSetReplicaReady(novaNames.MetadataStatefulSetName)

scheduler := GetNovaScheduler(novaNames.SchedulerName)
Expand Down Expand Up @@ -421,15 +421,15 @@ var _ = Describe("Nova controller", func() {
})

It("creates NovaMetadata", func() {
th.SimulateKeystoneServiceReady(novaNames.KeystoneServiceName)
keystone.SimulateKeystoneServiceReady(novaNames.KeystoneServiceName)
th.SimulateMariaDBDatabaseCompleted(novaNames.APIMariaDBDatabaseName)
th.SimulateMariaDBDatabaseCompleted(cell0.MariaDBDatabaseName)
th.SimulateTransportURLReady(cell0.TransportURLName)
th.SimulateJobSuccess(cell0.DBSyncJobName)
th.SimulateStatefulSetReplicaReady(cell0.ConductorStatefulSetName)
th.SimulateJobSuccess(cell0.CellMappingJobName)
th.SimulateStatefulSetReplicaReady(novaNames.APIDeploymentName)
th.SimulateKeystoneEndpointReady(novaNames.APIKeystoneEndpointName)
keystone.SimulateKeystoneEndpointReady(novaNames.APIKeystoneEndpointName)
th.SimulateStatefulSetReplicaReady(novaNames.SchedulerStatefulSetName)

metadata := GetNovaMetadata(novaNames.MetadataName)
Expand Down Expand Up @@ -476,11 +476,11 @@ var _ = Describe("Nova controller", func() {
},
),
)
DeferCleanup(th.DeleteKeystoneAPI, th.CreateKeystoneAPI(novaNames.NovaName.Namespace))
DeferCleanup(keystone.DeleteKeystoneAPI, keystone.CreateKeystoneAPI(novaNames.NovaName.Namespace))

DeferCleanup(th.DeleteInstance, CreateNovaWithCell0(novaNames.NovaName))

th.SimulateKeystoneServiceReady(novaNames.KeystoneServiceName)
keystone.SimulateKeystoneServiceReady(novaNames.KeystoneServiceName)
th.SimulateMariaDBDatabaseCompleted(novaNames.APIMariaDBDatabaseName)
th.SimulateMariaDBDatabaseCompleted(cell0.MariaDBDatabaseName)
th.SimulateTransportURLReady(cell0.TransportURLName)
Expand Down Expand Up @@ -542,11 +542,11 @@ var _ = Describe("Nova controller", func() {
},
),
)
DeferCleanup(th.DeleteKeystoneAPI, th.CreateKeystoneAPI(novaNames.NovaName.Namespace))
DeferCleanup(keystone.DeleteKeystoneAPI, keystone.CreateKeystoneAPI(novaNames.NovaName.Namespace))

DeferCleanup(th.DeleteInstance, CreateNovaWithCell0(novaNames.NovaName))

th.SimulateKeystoneServiceReady(novaNames.KeystoneServiceName)
keystone.SimulateKeystoneServiceReady(novaNames.KeystoneServiceName)
th.SimulateMariaDBDatabaseCompleted(novaNames.APIMariaDBDatabaseName)
th.SimulateMariaDBDatabaseCompleted(cell0.MariaDBDatabaseName)
th.SimulateTransportURLReady(cell0.TransportURLName)
Expand Down Expand Up @@ -600,7 +600,7 @@ var _ = Describe("Nova controller", func() {
},
),
)
DeferCleanup(th.DeleteKeystoneAPI, th.CreateKeystoneAPI(novaNames.NovaName.Namespace))
DeferCleanup(keystone.DeleteKeystoneAPI, keystone.CreateKeystoneAPI(novaNames.NovaName.Namespace))

spec := GetDefaultNovaSpec()
cell0template := GetDefaultNovaCellTemplate()
Expand All @@ -612,7 +612,7 @@ var _ = Describe("Nova controller", func() {
})

It("uses the correct hostnames to access the different DB services", func() {
th.SimulateKeystoneServiceReady(novaNames.KeystoneServiceName)
keystone.SimulateKeystoneServiceReady(novaNames.KeystoneServiceName)
th.SimulateMariaDBDatabaseCompleted(novaNames.APIMariaDBDatabaseName)
th.SimulateMariaDBDatabaseCompleted(cell0.MariaDBDatabaseName)
th.SimulateTransportURLReady(cell0.TransportURLName)
Expand Down Expand Up @@ -677,7 +677,7 @@ var _ = Describe("Nova controller", func() {
Expect(configData).To(ContainSubstring("password = service-password"))

th.SimulateStatefulSetReplicaReady(novaNames.APIName)
th.SimulateKeystoneEndpointReady(novaNames.APIKeystoneEndpointName)
keystone.SimulateKeystoneEndpointReady(novaNames.APIKeystoneEndpointName)

th.ExpectCondition(
cell0.ConductorName,
Expand Down Expand Up @@ -734,30 +734,30 @@ var _ = Describe("Nova controller", func() {
},
),
)
DeferCleanup(th.DeleteKeystoneAPI, th.CreateKeystoneAPI(novaNames.NovaName.Namespace))
DeferCleanup(keystone.DeleteKeystoneAPI, keystone.CreateKeystoneAPI(novaNames.NovaName.Namespace))

DeferCleanup(th.DeleteInstance, CreateNovaWithCell0(novaNames.NovaName))
})

It("removes the finalizer from KeystoneService", func() {
th.SimulateKeystoneServiceReady(novaNames.KeystoneServiceName)
keystone.SimulateKeystoneServiceReady(novaNames.KeystoneServiceName)
th.ExpectCondition(
novaNames.NovaName,
ConditionGetterFunc(NovaConditionGetter),
condition.KeystoneServiceReadyCondition,
corev1.ConditionTrue,
)

service := th.GetKeystoneService(novaNames.KeystoneServiceName)
service := keystone.GetKeystoneService(novaNames.KeystoneServiceName)
Expect(service.Finalizers).To(ContainElement("Nova"))

th.DeleteInstance(GetNova(novaNames.NovaName))
service = th.GetKeystoneService(novaNames.KeystoneServiceName)
service = keystone.GetKeystoneService(novaNames.KeystoneServiceName)
Expect(service.Finalizers).NotTo(ContainElement("Nova"))
})

It("removes the finalizers from the nova dbs", func() {
th.SimulateKeystoneServiceReady(novaNames.KeystoneServiceName)
keystone.SimulateKeystoneServiceReady(novaNames.KeystoneServiceName)

apiDB := th.GetMariaDBDatabase(novaNames.APIMariaDBDatabaseName)
Expect(apiDB.Finalizers).To(ContainElement("Nova"))
Expand Down Expand Up @@ -789,7 +789,7 @@ var _ = Describe("Nova controller", func() {
},
),
)
DeferCleanup(th.DeleteKeystoneAPI, th.CreateKeystoneAPI(novaNames.NovaName.Namespace))
DeferCleanup(keystone.DeleteKeystoneAPI, keystone.CreateKeystoneAPI(novaNames.NovaName.Namespace))

nad := th.CreateNetworkAttachmentDefinition(novaNames.InternalAPINetworkNADName)
DeferCleanup(th.DeleteInstance, nad)
Expand Down Expand Up @@ -827,7 +827,7 @@ var _ = Describe("Nova controller", func() {
}
DeferCleanup(th.DeleteInstance, CreateNova(novaNames.NovaName, rawSpec))

th.SimulateKeystoneServiceReady(novaNames.KeystoneServiceName)
keystone.SimulateKeystoneServiceReady(novaNames.KeystoneServiceName)
th.SimulateMariaDBDatabaseCompleted(novaNames.APIMariaDBDatabaseName)
th.SimulateMariaDBDatabaseCompleted(cell0.MariaDBDatabaseName)
th.SimulateTransportURLReady(cell0.TransportURLName)
Expand All @@ -853,7 +853,7 @@ var _ = Describe("Nova controller", func() {
novaNames.MetadataStatefulSetName,
map[string][]string{novaNames.NovaName.Namespace + "/internalapi": {"10.0.0.1"}},
)
th.SimulateKeystoneEndpointReady(novaNames.APIKeystoneEndpointName)
keystone.SimulateKeystoneEndpointReady(novaNames.APIKeystoneEndpointName)

th.ExpectCondition(
novaNames.NovaName,
Expand Down
Loading

0 comments on commit e0d0bfe

Please sign in to comment.