diff --git a/Makefile b/Makefile index e6a2cc10..2fb982aa 100644 --- a/Makefile +++ b/Makefile @@ -148,6 +148,7 @@ $(GINKGO): $(LOCALBIN) test: manifests generate fmt vet envtest ginkgo ## Run tests. go test -v ./pkg/.. ./controllers/.. ./api/.. -coverprofile cover.out KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" \ + OPERATOR_TEMPLATES="$(shell pwd)/templates" \ $(GINKGO) --trace --cover --coverprofile cover.out --covermode=atomic --randomize-all ${PROC_CMD} $(GINKGO_ARGS) ./test/functional/... .PHONY: gowork gowork: export GOWORK= diff --git a/api/bases/manila.openstack.org_manilaapis.yaml b/api/bases/manila.openstack.org_manilaapis.yaml index 7171ef84..aead2208 100644 --- a/api/bases/manila.openstack.org_manilaapis.yaml +++ b/api/bases/manila.openstack.org_manilaapis.yaml @@ -49,11 +49,11 @@ spec: items: type: string type: array - databaseHostname: - type: string - databaseUser: + databaseAccount: default: manila type: string + databaseHostname: + type: string extraMounts: items: properties: @@ -871,12 +871,8 @@ spec: type: object passwordSelectors: default: - database: ManilaDatabasePassword service: ManilaPassword properties: - database: - default: ManilaDatabasePassword - type: string service: default: ManilaPassword type: string diff --git a/api/bases/manila.openstack.org_manilas.yaml b/api/bases/manila.openstack.org_manilas.yaml index d4f52ee0..98eeae92 100644 --- a/api/bases/manila.openstack.org_manilas.yaml +++ b/api/bases/manila.openstack.org_manilas.yaml @@ -39,11 +39,11 @@ spec: customServiceConfig: default: '# add your customization here' type: string - databaseInstance: - type: string - databaseUser: + databaseAccount: default: manila type: string + databaseInstance: + type: string dbPurge: properties: age: @@ -1072,12 +1072,8 @@ spec: type: object passwordSelectors: default: - database: ManilaDatabasePassword service: ManilaPassword properties: - database: - default: ManilaDatabasePassword - type: string service: default: ManilaPassword type: string diff --git a/api/bases/manila.openstack.org_manilaschedulers.yaml b/api/bases/manila.openstack.org_manilaschedulers.yaml index 37ba87a6..233baaaf 100644 --- a/api/bases/manila.openstack.org_manilaschedulers.yaml +++ b/api/bases/manila.openstack.org_manilaschedulers.yaml @@ -49,11 +49,11 @@ spec: items: type: string type: array - databaseHostname: - type: string - databaseUser: + databaseAccount: default: manila type: string + databaseHostname: + type: string extraMounts: items: properties: @@ -820,12 +820,8 @@ spec: type: object passwordSelectors: default: - database: ManilaDatabasePassword service: ManilaPassword properties: - database: - default: ManilaDatabasePassword - type: string service: default: ManilaPassword type: string diff --git a/api/bases/manila.openstack.org_manilashares.yaml b/api/bases/manila.openstack.org_manilashares.yaml index c5dd12f0..5686d3d1 100644 --- a/api/bases/manila.openstack.org_manilashares.yaml +++ b/api/bases/manila.openstack.org_manilashares.yaml @@ -49,11 +49,11 @@ spec: items: type: string type: array - databaseHostname: - type: string - databaseUser: + databaseAccount: default: manila type: string + databaseHostname: + type: string extraMounts: items: properties: @@ -820,12 +820,8 @@ spec: type: object passwordSelectors: default: - database: ManilaDatabasePassword service: ManilaPassword properties: - database: - default: ManilaDatabasePassword - type: string service: default: ManilaPassword type: string diff --git a/api/v1beta1/common_types.go b/api/v1beta1/common_types.go index 716de02b..f00a770a 100644 --- a/api/v1beta1/common_types.go +++ b/api/v1beta1/common_types.go @@ -45,17 +45,16 @@ type ManilaTemplate struct { // +kubebuilder:validation:Optional // +kubebuilder:default=manila - // DatabaseUser - optional username used for manila DB, defaults to manila - // TODO: -> implement needs work in mariadb-operator, right now only manila - DatabaseUser string `json:"databaseUser,omitempty"` + // DatabaseAccount - optional MariaDBAccount CR name used for manila DB, defaults to manila + DatabaseAccount string `json:"databaseAccount"` // +kubebuilder:validation:Optional - // Secret containing OpenStack password information for ManilaDatabasePassword, AdminPassword + // Secret containing OpenStack password information for AdminPassword Secret string `json:"secret,omitempty"` // +kubebuilder:validation:Optional - // +kubebuilder:default={database: ManilaDatabasePassword, service: ManilaPassword} - // PasswordSelectors - Selectors to identify the DB and ServiceUser password from the Secret + // +kubebuilder:default={service: ManilaPassword} + // PasswordSelectors - Selectors to identify the ServiceUser password from the Secret PasswordSelectors PasswordSelector `json:"passwordSelectors,omitempty"` } @@ -92,11 +91,6 @@ type ManilaServiceTemplate struct { // PasswordSelector to identify the DB and AdminUser password from the Secret type PasswordSelector struct { - // +kubebuilder:validation:Optional - // +kubebuilder:default="ManilaDatabasePassword" - // Database - Selector to get the manila database user password from the Secret - // TODO: not used, need change in mariadb-operator - Database string `json:"database,omitempty"` // +kubebuilder:validation:Optional // +kubebuilder:default="ManilaPassword" // Service - Selector to get the manila service password from the Secret diff --git a/config/crd/bases/manila.openstack.org_manilaapis.yaml b/config/crd/bases/manila.openstack.org_manilaapis.yaml index 7171ef84..aead2208 100644 --- a/config/crd/bases/manila.openstack.org_manilaapis.yaml +++ b/config/crd/bases/manila.openstack.org_manilaapis.yaml @@ -49,11 +49,11 @@ spec: items: type: string type: array - databaseHostname: - type: string - databaseUser: + databaseAccount: default: manila type: string + databaseHostname: + type: string extraMounts: items: properties: @@ -871,12 +871,8 @@ spec: type: object passwordSelectors: default: - database: ManilaDatabasePassword service: ManilaPassword properties: - database: - default: ManilaDatabasePassword - type: string service: default: ManilaPassword type: string diff --git a/config/crd/bases/manila.openstack.org_manilas.yaml b/config/crd/bases/manila.openstack.org_manilas.yaml index d4f52ee0..98eeae92 100644 --- a/config/crd/bases/manila.openstack.org_manilas.yaml +++ b/config/crd/bases/manila.openstack.org_manilas.yaml @@ -39,11 +39,11 @@ spec: customServiceConfig: default: '# add your customization here' type: string - databaseInstance: - type: string - databaseUser: + databaseAccount: default: manila type: string + databaseInstance: + type: string dbPurge: properties: age: @@ -1072,12 +1072,8 @@ spec: type: object passwordSelectors: default: - database: ManilaDatabasePassword service: ManilaPassword properties: - database: - default: ManilaDatabasePassword - type: string service: default: ManilaPassword type: string diff --git a/config/crd/bases/manila.openstack.org_manilaschedulers.yaml b/config/crd/bases/manila.openstack.org_manilaschedulers.yaml index 37ba87a6..233baaaf 100644 --- a/config/crd/bases/manila.openstack.org_manilaschedulers.yaml +++ b/config/crd/bases/manila.openstack.org_manilaschedulers.yaml @@ -49,11 +49,11 @@ spec: items: type: string type: array - databaseHostname: - type: string - databaseUser: + databaseAccount: default: manila type: string + databaseHostname: + type: string extraMounts: items: properties: @@ -820,12 +820,8 @@ spec: type: object passwordSelectors: default: - database: ManilaDatabasePassword service: ManilaPassword properties: - database: - default: ManilaDatabasePassword - type: string service: default: ManilaPassword type: string diff --git a/config/crd/bases/manila.openstack.org_manilashares.yaml b/config/crd/bases/manila.openstack.org_manilashares.yaml index c5dd12f0..5686d3d1 100644 --- a/config/crd/bases/manila.openstack.org_manilashares.yaml +++ b/config/crd/bases/manila.openstack.org_manilashares.yaml @@ -49,11 +49,11 @@ spec: items: type: string type: array - databaseHostname: - type: string - databaseUser: + databaseAccount: default: manila type: string + databaseHostname: + type: string extraMounts: items: properties: @@ -820,12 +820,8 @@ spec: type: object passwordSelectors: default: - database: ManilaDatabasePassword service: ManilaPassword properties: - database: - default: ManilaDatabasePassword - type: string service: default: ManilaPassword type: string diff --git a/controllers/manila_controller.go b/controllers/manila_controller.go index 945c2ec7..030ce642 100644 --- a/controllers/manila_controller.go +++ b/controllers/manila_controller.go @@ -336,7 +336,7 @@ func (r *ManilaReconciler) reconcileDelete(ctx context.Context, instance *manila r.Log.Info(fmt.Sprintf("Reconciling Service '%s' delete", instance.Name)) // remove db finalizer first - db, err := mariadbv1.GetDatabaseByName(ctx, helper, manila.DatabaseName) + db, err := mariadbv1.GetDatabaseByNameAndAccount(ctx, helper, manila.DatabaseCRName, instance.Spec.DatabaseAccount, instance.Namespace) if err != nil && !k8s_errors.IsNotFound(err) { return ctrl.Result{}, err } @@ -664,6 +664,14 @@ func (r *ManilaReconciler) reconcileNormal(ctx context.Context, instance *manila r.Log.Info(fmt.Sprintf("Deployment %s successfully reconciled - operation: %s", instance.Name, string(op))) } + // remove finalizers from unused MariaDBAccount records + err = mariadbv1.DeleteUnusedMariaDBAccountFinalizers( + ctx, helper, manila.DatabaseCRName, + instance.Spec.DatabaseAccount, instance.Namespace) + if err != nil { + return ctrl.Result{}, err + } + // Mirror ManilaAPI status' ReadyCount to this parent CR instance.Status.ManilaAPIReadyCount = manilaAPI.Status.ReadyCount @@ -843,6 +851,9 @@ func (r *ManilaReconciler) generateServiceConfig( return err } + databaseAccount := db.GetAccount() + databaseSecret := db.GetSecret() + // templateParameters := make(map[string]interface{}) templateParameters := map[string]interface{}{ "ServiceUser": instance.Spec.ServiceUser, @@ -850,11 +861,14 @@ func (r *ManilaReconciler) generateServiceConfig( "KeystonePublicURL": keystonePublicURL, "KeystoneInternalURL": keystoneInternalURL, "TransportURL": string(transportURLSecret.Data["transport_url"]), + // FIXME(zzzeek) / (mschuppert) - we have added my.cnf to customData + // above. Why is it not being consumed here via read_default_file=/etc/my.cnf? + // this is required for SSL database connections to work "DatabaseConnection": fmt.Sprintf("mysql+pymysql://%s:%s@%s/%s", - instance.Spec.DatabaseUser, - string(ospSecret.Data[instance.Spec.PasswordSelectors.Database]), + databaseAccount.Spec.UserName, + string(databaseSecret.Data[mariadbv1.DatabasePasswordSelector]), instance.Status.DatabaseHostname, - manila.DatabaseName), + manila.DatabaseCRName), "MemcachedServersWithInet": strings.Join(memcached.Status.ServerListWithInet, ","), } @@ -1073,24 +1087,45 @@ func (r *ManilaReconciler) ensureDB( h *helper.Helper, instance *manilav1beta1.Manila, ) (*mariadbv1.Database, ctrl.Result, error) { + // ensure MariaDBAccount exists. This account record may be created by + // openstack-operator or the cloud operator up front without a specific + // MariaDBDatabase configured yet. Otherwise, a MariaDBAccount CR is + // created here with a generated username as well as a secret with + // generated password. The MariaDBAccount is created without being + // yet associated with any MariaDBDatabase. + _, _, err := mariadbv1.EnsureMariaDBAccount( + ctx, h, instance.Spec.DatabaseAccount, + instance.Namespace, false, manila.DatabaseUsernamePrefix, + ) + + if err != nil { + instance.Status.Conditions.Set(condition.FalseCondition( + mariadbv1.MariaDBAccountReadyCondition, + condition.ErrorReason, + condition.SeverityWarning, + mariadbv1.MariaDBAccountNotReadyMessage, + err.Error())) + + return nil, ctrl.Result{}, err + } + instance.Status.Conditions.MarkTrue( + mariadbv1.MariaDBAccountReadyCondition, + mariadbv1.MariaDBAccountReadyMessage) + // // create service DB instance // - db := mariadbv1.NewDatabase( - manila.DatabaseName, - instance.Spec.DatabaseUser, - instance.Spec.Secret, - map[string]string{ - "dbName": instance.Spec.DatabaseInstance, - }, + db := mariadbv1.NewDatabaseForAccount( + instance.Spec.DatabaseInstance, // mariadb/galera service to target + manila.DatabaseName, // name used in CREATE DATABASE in mariadb + manila.DatabaseCRName, // CR name for MariaDBDatabase + instance.Spec.DatabaseAccount, // CR name for MariaDBAccount + instance.Namespace, // namespace ) // create or patch the DB - ctrlResult, err := db.CreateOrPatchDBByName( - ctx, - h, - instance.Spec.DatabaseInstance, - ) + ctrlResult, err := db.CreateOrPatchAll(ctx, h) + if err != nil { instance.Status.Conditions.Set(condition.FalseCondition( condition.DBReadyCondition, diff --git a/controllers/manilaapi_controller.go b/controllers/manilaapi_controller.go index 93d2edcb..43450d4d 100644 --- a/controllers/manilaapi_controller.go +++ b/controllers/manilaapi_controller.go @@ -941,7 +941,7 @@ func (r *ManilaAPIReconciler) generateServiceConfig( labels := labels.GetLabels(instance, labels.GetGroupLabel(manila.ServiceName), serviceLabels) - db, err := mariadbv1.GetDatabaseByName(ctx, h, manila.DatabaseName) + db, err := mariadbv1.GetDatabaseByNameAndAccount(ctx, h, manila.DatabaseCRName, instance.Spec.DatabaseAccount, instance.Namespace) if err != nil { return err } diff --git a/controllers/manilascheduler_controller.go b/controllers/manilascheduler_controller.go index 79b0a781..1952a29b 100644 --- a/controllers/manilascheduler_controller.go +++ b/controllers/manilascheduler_controller.go @@ -647,7 +647,7 @@ func (r *ManilaSchedulerReconciler) generateServiceConfig( labels := labels.GetLabels(instance, labels.GetGroupLabel(manila.ServiceName), serviceLabels) - db, err := mariadbv1.GetDatabaseByName(ctx, h, manila.DatabaseName) + db, err := mariadbv1.GetDatabaseByNameAndAccount(ctx, h, manila.DatabaseCRName, instance.Spec.DatabaseAccount, instance.Namespace) if err != nil { return err } diff --git a/controllers/manilashare_controller.go b/controllers/manilashare_controller.go index 1006ebb8..43c1b8cc 100644 --- a/controllers/manilashare_controller.go +++ b/controllers/manilashare_controller.go @@ -644,7 +644,7 @@ func (r *ManilaShareReconciler) generateServiceConfig( labels := labels.GetLabels(instance, labels.GetGroupLabel(manila.ServiceName), serviceLabels) - db, err := mariadbv1.GetDatabaseByName(ctx, h, manila.DatabaseName) + db, err := mariadbv1.GetDatabaseByNameAndAccount(ctx, h, manila.DatabaseCRName, instance.Spec.DatabaseAccount, instance.Namespace) if err != nil { return err } diff --git a/go.mod b/go.mod index a3dc9f2b..b67bb9c3 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/openstack-k8s-operators/lib-common/modules/storage v0.3.1-0.20240224182407-3b6c02b195f6 github.com/openstack-k8s-operators/lib-common/modules/test v0.3.1-0.20240224182407-3b6c02b195f6 github.com/openstack-k8s-operators/manila-operator/api v0.0.0-00010101000000-000000000000 - github.com/openstack-k8s-operators/mariadb-operator/api v0.3.1-0.20240220132409-f96d4d040f4e + github.com/openstack-k8s-operators/mariadb-operator/api v0.3.1-0.20240303091826-438dde8600d3 k8s.io/api v0.28.7 k8s.io/apimachinery v0.28.7 k8s.io/client-go v0.28.7 diff --git a/go.sum b/go.sum index 40adfe45..092c9b2a 100644 --- a/go.sum +++ b/go.sum @@ -103,8 +103,8 @@ github.com/openstack-k8s-operators/lib-common/modules/storage v0.3.1-0.202402241 github.com/openstack-k8s-operators/lib-common/modules/storage v0.3.1-0.20240224182407-3b6c02b195f6/go.mod h1:Qg6DbOUHCzMCGhRikhN0XTWSOBOX9uB9z74jTbjyOUk= github.com/openstack-k8s-operators/lib-common/modules/test v0.3.1-0.20240224182407-3b6c02b195f6 h1:8SbXBGb7qgvYTXF9WiaNg1esn2J7mVXkqcAC0pIZJe4= github.com/openstack-k8s-operators/lib-common/modules/test v0.3.1-0.20240224182407-3b6c02b195f6/go.mod h1:82nzS+DbBe1tzaMvNHH8FctmZzQ14ZAJysFGsMJiivo= -github.com/openstack-k8s-operators/mariadb-operator/api v0.3.1-0.20240220132409-f96d4d040f4e h1:6vqp5HZwcGvPH0MII/23iCd97T3/1HJZlONKW6LyNio= -github.com/openstack-k8s-operators/mariadb-operator/api v0.3.1-0.20240220132409-f96d4d040f4e/go.mod h1:PDqfLbP4ZWqQHAu1OtbjfpOGQUKSzLqRJChvE/9pcyQ= +github.com/openstack-k8s-operators/mariadb-operator/api v0.3.1-0.20240303091826-438dde8600d3 h1:fwb+GvvnN9Mhkgg5pBksZ8W5+hLCcNOorHsUTQYA1Lg= +github.com/openstack-k8s-operators/mariadb-operator/api v0.3.1-0.20240303091826-438dde8600d3/go.mod h1:f9IIyWeoskWoeWaDFF3qmAJ2Kqyovfi0Ar/QUfk3qag= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= diff --git a/pkg/manila/const.go b/pkg/manila/const.go index ef118c0c..cc9ba9d7 100644 --- a/pkg/manila/const.go +++ b/pkg/manila/const.go @@ -25,8 +25,14 @@ const ( ServiceNameV2 = "manilav2" // ServiceTypeV2 - API V2 service type, supported ServiceTypeV2 = "sharev2" - // DatabaseName - + + // DatabaseName - Name of the database used in CREATE DATABASE statement DatabaseName = "manila" + // DatabaseCRName - Name of the MariaDBDatabase CR + DatabaseCRName = "manila" + // DatabaseUsernamePrefix - used by EnsureMariaDBAccount when a new username + // is to be generated, e.g. "manila_e5a4", "manila_78bc", etc + DatabaseUsernamePrefix = "manila" // ManilaPublicPort - ManilaPublicPort int32 = 8786 diff --git a/test/functional/base_test.go b/test/functional/base_test.go index bfd3104c..19e6b125 100644 --- a/test/functional/base_test.go +++ b/test/functional/base_test.go @@ -33,9 +33,8 @@ func CreateManilaSecret(namespace string, name string) *corev1.Secret { return th.CreateSecret( types.NamespacedName{Namespace: namespace, Name: name}, map[string][]byte{ - "ManilaPassword": []byte(manilaTest.ManilaPassword), - "ManilaDatabasePassword": []byte(manilaTest.ManilaPassword), - "MetadataSecret": []byte(manilaTest.ManilaPassword), + "ManilaPassword": []byte(manilaTest.ManilaPassword), + "MetadataSecret": []byte(manilaTest.ManilaPassword), }, ) } diff --git a/test/functional/manila_controller_test.go b/test/functional/manila_controller_test.go index 8f708a3b..6f264e0e 100644 --- a/test/functional/manila_controller_test.go +++ b/test/functional/manila_controller_test.go @@ -21,6 +21,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" . "github.com/openstack-k8s-operators/lib-common/modules/common/test/helpers" + mariadb_test "github.com/openstack-k8s-operators/mariadb-operator/api/test/helpers" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" "k8s.io/utils/ptr" @@ -29,6 +30,7 @@ import ( condition "github.com/openstack-k8s-operators/lib-common/modules/common/condition" util "github.com/openstack-k8s-operators/lib-common/modules/common/util" manilav1 "github.com/openstack-k8s-operators/manila-operator/api/v1beta1" + "github.com/openstack-k8s-operators/manila-operator/pkg/manila" ) var _ = Describe("Manila controller", func() { @@ -63,7 +65,7 @@ var _ = Describe("Manila controller", func() { It("should have the Spec fields initialized", func() { Manila := GetManila(manilaTest.Instance) Expect(Manila.Spec.DatabaseInstance).Should(Equal("openstack")) - Expect(Manila.Spec.DatabaseUser).Should(Equal(manilaTest.ManilaDataBaseUser)) + Expect(Manila.Spec.DatabaseAccount).Should(Equal(manilaTest.ManilaDatabaseAccount.Name)) Expect(Manila.Spec.MemcachedInstance).Should(Equal(manilaTest.MemcachedInstance)) Expect(Manila.Spec.RabbitMqClusterName).Should(Equal(manilaTest.RabbitmqClusterName)) Expect(Manila.Spec.ServiceUser).Should(Equal(manilaTest.ManilaServiceUser)) @@ -155,8 +157,8 @@ var _ = Describe("Manila controller", func() { DeferCleanup(keystone.DeleteKeystoneAPI, keystone.CreateKeystoneAPI(namespace)) }) It("Should set DBReady Condition and set DatabaseHostname Status when DB is Created", func() { - mariadb.SimulateMariaDBDatabaseCompleted(manilaTest.Instance) - mariadb.SimulateMariaDBAccountCompleted(manilaTest.Instance) + mariadb.SimulateMariaDBDatabaseCompleted(manilaTest.ManilaDatabaseName) + mariadb.SimulateMariaDBAccountCompleted(manilaTest.ManilaDatabaseAccount) th.SimulateJobSuccess(manilaTest.ManilaDBSync) Manila := GetManila(manilaTest.Instance) Expect(Manila.Status.DatabaseHostname).To( @@ -175,8 +177,8 @@ var _ = Describe("Manila controller", func() { ) }) It("Should fail if db-sync job fails when DB is Created", func() { - mariadb.SimulateMariaDBDatabaseCompleted(manilaTest.Instance) - mariadb.SimulateMariaDBAccountCompleted(manilaTest.Instance) + mariadb.SimulateMariaDBDatabaseCompleted(manilaTest.ManilaDatabaseName) + mariadb.SimulateMariaDBAccountCompleted(manilaTest.ManilaDatabaseAccount) th.SimulateJobFailure(manilaTest.ManilaDBSync) th.ExpectCondition( manilaTest.Instance, @@ -216,8 +218,8 @@ var _ = Describe("Manila controller", func() { infra.SimulateTransportURLReady(manilaTest.ManilaTransportURL) DeferCleanup(infra.DeleteMemcached, infra.CreateMemcached(namespace, "memcached", memcachedSpec)) infra.SimulateMemcachedReady(manilaTest.ManilaMemcached) - mariadb.SimulateMariaDBDatabaseCompleted(manilaTest.Instance) - mariadb.SimulateMariaDBAccountCompleted(manilaTest.Instance) + mariadb.SimulateMariaDBDatabaseCompleted(manilaTest.ManilaDatabaseName) + mariadb.SimulateMariaDBAccountCompleted(manilaTest.ManilaDatabaseAccount) }) It("should create config-data and scripts ConfigMaps", func() { keystoneAPI := keystone.CreateKeystoneAPI(manilaTest.Instance.Namespace) @@ -269,8 +271,8 @@ var _ = Describe("Manila controller", func() { DeferCleanup(infra.DeleteMemcached, infra.CreateMemcached(namespace, manilaTest.MemcachedInstance, memcachedSpec)) infra.SimulateMemcachedReady(manilaTest.ManilaMemcached) DeferCleanup(keystone.DeleteKeystoneAPI, keystone.CreateKeystoneAPI(manilaTest.Instance.Namespace)) - mariadb.SimulateMariaDBDatabaseCompleted(manilaTest.Instance) - mariadb.SimulateMariaDBAccountCompleted(manilaTest.Instance) + mariadb.SimulateMariaDBDatabaseCompleted(manilaTest.ManilaDatabaseName) + mariadb.SimulateMariaDBAccountCompleted(manilaTest.ManilaDatabaseAccount) th.SimulateJobSuccess(manilaTest.ManilaDBSync) keystone.SimulateKeystoneServiceReady(manilaTest.Instance) keystone.SimulateKeystoneEndpointReady(manilaTest.ManilaKeystoneEndpoint) @@ -307,19 +309,19 @@ var _ = Describe("Manila controller", func() { DeferCleanup(infra.DeleteMemcached, infra.CreateMemcached(namespace, manilaTest.MemcachedInstance, memcachedSpec)) infra.SimulateMemcachedReady(manilaTest.ManilaMemcached) DeferCleanup(keystone.DeleteKeystoneAPI, keystone.CreateKeystoneAPI(manilaTest.Instance.Namespace)) - mariadb.SimulateMariaDBDatabaseCompleted(manilaTest.Instance) - mariadb.SimulateMariaDBAccountCompleted(manilaTest.Instance) + mariadb.SimulateMariaDBDatabaseCompleted(manilaTest.ManilaDatabaseName) + mariadb.SimulateMariaDBAccountCompleted(manilaTest.ManilaDatabaseAccount) th.SimulateJobSuccess(manilaTest.ManilaDBSync) }) It("removes the finalizers from the Manila DB", func() { keystone.SimulateKeystoneServiceReady(manilaTest.Instance) - mDB := mariadb.GetMariaDBDatabase(manilaTest.Instance) + mDB := mariadb.GetMariaDBDatabase(manilaTest.ManilaDatabaseName) Expect(mDB.Finalizers).To(ContainElement("Manila")) th.DeleteInstance(GetManila(manilaTest.Instance)) - mDB = mariadb.GetMariaDBDatabase(manilaTest.Instance) + mDB = mariadb.GetMariaDBDatabase(manilaTest.ManilaDatabaseName) Expect(mDB.Finalizers).NotTo(ContainElement("Manila")) }) }) @@ -389,8 +391,8 @@ var _ = Describe("Manila controller", func() { Eventually(func(g Gomega) { g.Expect(k8sClient.Status().Update(ctx, keystoneAPI.DeepCopy())).Should(Succeed()) }, timeout, interval).Should(Succeed()) - mariadb.SimulateMariaDBDatabaseCompleted(manilaTest.Instance) - mariadb.SimulateMariaDBAccountCompleted(manilaTest.Instance) + mariadb.SimulateMariaDBDatabaseCompleted(manilaTest.ManilaDatabaseName) + mariadb.SimulateMariaDBAccountCompleted(manilaTest.ManilaDatabaseAccount) th.SimulateJobSuccess(manilaTest.ManilaDBSync) keystone.SimulateKeystoneServiceReady(manilaTest.Instance) }) @@ -471,8 +473,8 @@ var _ = Describe("Manila controller", func() { DeferCleanup(infra.DeleteMemcached, infra.CreateMemcached(namespace, manilaTest.MemcachedInstance, memcachedSpec)) infra.SimulateMemcachedReady(manilaTest.ManilaMemcached) DeferCleanup(keystone.DeleteKeystoneAPI, keystone.CreateKeystoneAPI(manilaTest.Instance.Namespace)) - mariadb.SimulateMariaDBTLSDatabaseCompleted(manilaTest.Instance) - mariadb.SimulateMariaDBAccountCompleted(manilaTest.Instance) + mariadb.SimulateMariaDBTLSDatabaseCompleted(manilaTest.ManilaDatabaseName) + mariadb.SimulateMariaDBAccountCompleted(manilaTest.ManilaDatabaseAccount) th.SimulateJobSuccess(manilaTest.ManilaDBSync) }) @@ -618,4 +620,86 @@ var _ = Describe("Manila controller", func() { Expect(endpoints).To(HaveKeyWithValue("internal", "https://manila-internal."+namespace+".svc:8786/v2")) }) }) + + // Run MariaDBAccount suite tests. these are pre-packaged ginkgo tests + // that exercise standard account create / update patterns that should be + // common to all controllers that ensure MariaDBAccount CRs. + mariadbSuite := &mariadb_test.MariaDBTestHarness{ + PopulateHarness: func(harness *mariadb_test.MariaDBTestHarness) { + harness.Setup( + "Manila", + manilaTest.Instance.Namespace, + manilaTest.Instance.Name, + "Manila", + mariadb, timeout, interval, + ) + }, + + // Generate a fully running service given an accountName + // needs to make it all the way to the end where the mariadb finalizers + // are removed from unused accounts since that's part of what we are testing + SetupCR: func(accountName types.NamespacedName) { + memcachedSpec = memcachedv1.MemcachedSpec{ + Replicas: ptr.To(int32(3)), + } + + spec := GetDefaultManilaSpec() + spec["databaseAccount"] = accountName.Name + DeferCleanup(th.DeleteInstance, CreateManila(manilaTest.Instance, spec)) + DeferCleanup(k8sClient.Delete, ctx, CreateManilaMessageBusSecret(manilaTest.Instance.Namespace, manilaTest.RabbitmqSecretName)) + DeferCleanup(th.DeleteInstance, CreateManilaAPI(manilaTest.Instance, GetDefaultManilaAPISpec())) + DeferCleanup(th.DeleteInstance, CreateManilaScheduler(manilaTest.Instance, GetDefaultManilaSchedulerSpec())) + DeferCleanup(th.DeleteInstance, CreateManilaShare(manilaTest.Instance, GetDefaultManilaShareSpec())) + DeferCleanup( + mariadb.DeleteDBService, + mariadb.CreateDBService( + manilaTest.Instance.Namespace, + GetManila(manilaName).Spec.DatabaseInstance, + corev1.ServiceSpec{ + Ports: []corev1.ServicePort{{Port: 3306}}, + }, + ), + ) + infra.SimulateTransportURLReady(manilaTest.ManilaTransportURL) + DeferCleanup(infra.DeleteMemcached, infra.CreateMemcached(namespace, manilaTest.MemcachedInstance, memcachedSpec)) + infra.SimulateMemcachedReady(manilaTest.ManilaMemcached) + DeferCleanup(keystone.DeleteKeystoneAPI, keystone.CreateKeystoneAPI(manilaTest.Instance.Namespace)) + mariadb.SimulateMariaDBDatabaseCompleted(manilaTest.ManilaDatabaseName) + mariadb.SimulateMariaDBAccountCompleted(accountName) + th.SimulateJobSuccess(manilaTest.ManilaDBSync) + keystone.SimulateKeystoneServiceReady(manilaTest.Instance) + keystone.SimulateKeystoneEndpointReady(manilaTest.ManilaKeystoneEndpoint) + }, + // Change the account name in the service to a new name + UpdateAccount: func(newAccountName types.NamespacedName) { + + Eventually(func(g Gomega) { + manila := GetManila(manilaName) + manila.Spec.DatabaseAccount = newAccountName.Name + g.Expect(th.K8sClient.Update(ctx, manila)).Should(Succeed()) + }, timeout, interval).Should(Succeed()) + + }, + // delete the CR instance to exercise finalizer removal + DeleteCR: func() { + th.DeleteInstance(GetManila(manilaName)) + }, + } + + mariadbSuite.RunBasicSuite() + + mariadbSuite.RunURLAssertSuite(func(accountName types.NamespacedName, username string, password string) { + Eventually(func(g Gomega) { + secretDataMap := th.GetSecret(manilaTest.ManilaConfigSecret) + + conf := secretDataMap.Data["00-config.conf"] + + g.Expect(string(conf)).Should( + ContainSubstring(fmt.Sprintf("connection = mysql+pymysql://%s:%s@hostname-for-openstack.%s.svc/%s", + username, password, namespace, manila.DatabaseName))) + + }).Should(Succeed()) + + }) + }) diff --git a/test/functional/manila_test_data.go b/test/functional/manila_test_data.go index 30f36c87..89ab1ec5 100644 --- a/test/functional/manila_test_data.go +++ b/test/functional/manila_test_data.go @@ -40,7 +40,6 @@ type ManilaTestData struct { RabbitmqClusterName string RabbitmqSecretName string MemcachedInstance string - ManilaDataBaseUser string ManilaPassword string ManilaServiceUser string Instance types.NamespacedName @@ -49,6 +48,7 @@ type ManilaTestData struct { ManilaTransportURL types.NamespacedName ManilaMemcached types.NamespacedName ManilaDatabaseName types.NamespacedName + ManilaDatabaseAccount types.NamespacedName ManilaSA types.NamespacedName ManilaDBSync types.NamespacedName ManilaKeystoneEndpoint types.NamespacedName @@ -85,7 +85,11 @@ func GetManilaTestData(manilaName types.NamespacedName) ManilaTestData { }, ManilaDatabaseName: types.NamespacedName{ Namespace: manilaName.Namespace, - Name: manila.DatabaseName, + Name: manila.DatabaseCRName, + }, + ManilaDatabaseAccount: types.NamespacedName{ + Namespace: manilaName.Namespace, + Name: "manila", }, ManilaDBSync: types.NamespacedName{ Namespace: manilaName.Namespace, @@ -170,8 +174,7 @@ func GetManilaTestData(manilaName types.NamespacedName) ManilaTestData { RabbitmqClusterName: "rabbitmq", RabbitmqSecretName: "rabbitmq-secret", MemcachedInstance: MemcachedInstance, - ManilaDataBaseUser: "manila", - // Password used for both db and service + // Password used for service ManilaPassword: "12345678", ManilaServiceUser: "manila", ContainerImage: "test://manila", diff --git a/test/functional/manilaapi_controller_test.go b/test/functional/manilaapi_controller_test.go index 4e0617d9..88be1f3c 100644 --- a/test/functional/manilaapi_controller_test.go +++ b/test/functional/manilaapi_controller_test.go @@ -51,10 +51,14 @@ var _ = Describe("ManilaAPI controller", func() { }, ), ) - mariadb.CreateMariaDBDatabase(manilaTest.Instance.Namespace, manilaTest.Instance.Name, mariadbv1.MariaDBDatabaseSpec{}) - mariadb.CreateMariaDBAccount(manilaTest.Instance.Namespace, manilaTest.Instance.Name, mariadbv1.MariaDBAccountSpec{}) - mariadb.SimulateMariaDBAccountCompleted(manilaTest.Instance) - mariadb.SimulateMariaDBDatabaseCompleted(manilaTest.Instance) + mariadb.CreateMariaDBDatabase(manilaTest.ManilaDatabaseName.Namespace, manilaTest.ManilaDatabaseName.Name, mariadbv1.MariaDBDatabaseSpec{}) + + dbAccount, dbSecret := mariadb.CreateMariaDBAccountAndSecret(manilaTest.ManilaDatabaseAccount, mariadbv1.MariaDBAccountSpec{}) + DeferCleanup(k8sClient.Delete, ctx, dbAccount) + DeferCleanup(k8sClient.Delete, ctx, dbSecret) + + mariadb.SimulateMariaDBAccountCompleted(manilaTest.ManilaDatabaseAccount) + mariadb.SimulateMariaDBDatabaseCompleted(manilaTest.ManilaDatabaseName) }) When("ManilaAPI CR is created", func() { @@ -98,8 +102,6 @@ var _ = Describe("ManilaAPI controller", func() { infra.SimulateTransportURLReady(manilaTest.ManilaTransportURL) infra.SimulateMemcachedReady(manilaTest.ManilaMemcached) DeferCleanup(keystone.DeleteKeystoneAPI, keystone.CreateKeystoneAPI(namespace)) - mariadb.SimulateMariaDBDatabaseCompleted(manilaTest.Instance) - mariadb.SimulateMariaDBAccountCompleted(manilaTest.Instance) th.SimulateJobSuccess(manilaTest.ManilaDBSync) keystone.SimulateKeystoneEndpointReady(manilaTest.ManilaKeystoneEndpoint) }) @@ -124,8 +126,6 @@ var _ = Describe("ManilaAPI controller", func() { When("manila-api-config is ready", func() { BeforeEach(func() { DeferCleanup(th.DeleteInstance, CreateManilaAPI(manilaTest.Instance, GetDefaultManilaAPISpec())) - mariadb.SimulateMariaDBDatabaseCompleted(manilaTest.Instance) - mariadb.SimulateMariaDBAccountCompleted(manilaTest.Instance) th.SimulateJobSuccess(manilaTest.ManilaDBSync) keystone.SimulateKeystoneEndpointReady(manilaTest.ManilaKeystoneEndpoint) keystone.SimulateKeystoneEndpointReady(manilaTest.Instance) diff --git a/test/functional/manilascheduler_controller_test.go b/test/functional/manilascheduler_controller_test.go index 6ad38823..30c29733 100644 --- a/test/functional/manilascheduler_controller_test.go +++ b/test/functional/manilascheduler_controller_test.go @@ -51,10 +51,15 @@ var _ = Describe("ManilaScheduler controller", func() { }, ), ) - mariadb.CreateMariaDBDatabase(manilaTest.Instance.Namespace, manilaTest.Instance.Name, mariadbv1.MariaDBDatabaseSpec{}) - mariadb.CreateMariaDBAccount(manilaTest.Instance.Namespace, manilaTest.Instance.Name, mariadbv1.MariaDBAccountSpec{}) - mariadb.SimulateMariaDBAccountCompleted(manilaTest.Instance) - mariadb.SimulateMariaDBDatabaseCompleted(manilaTest.Instance) + + mariadb.CreateMariaDBDatabase(manilaTest.ManilaDatabaseName.Namespace, manilaTest.ManilaDatabaseName.Name, mariadbv1.MariaDBDatabaseSpec{}) + + dbAccount, dbSecret := mariadb.CreateMariaDBAccountAndSecret(manilaTest.ManilaDatabaseAccount, mariadbv1.MariaDBAccountSpec{}) + DeferCleanup(k8sClient.Delete, ctx, dbAccount) + DeferCleanup(k8sClient.Delete, ctx, dbSecret) + + mariadb.SimulateMariaDBAccountCompleted(manilaTest.ManilaDatabaseAccount) + mariadb.SimulateMariaDBDatabaseCompleted(manilaTest.ManilaDatabaseName) }) When("ManilaScheduler CR is created", func() { @@ -98,8 +103,6 @@ var _ = Describe("ManilaScheduler controller", func() { infra.SimulateTransportURLReady(manilaTest.ManilaTransportURL) infra.SimulateMemcachedReady(manilaTest.ManilaMemcached) DeferCleanup(keystone.DeleteKeystoneAPI, keystone.CreateKeystoneAPI(namespace)) - mariadb.SimulateMariaDBDatabaseCompleted(manilaTest.Instance) - mariadb.SimulateMariaDBAccountCompleted(manilaTest.Instance) th.SimulateJobSuccess(manilaTest.ManilaDBSync) keystone.SimulateKeystoneEndpointReady(manilaTest.ManilaKeystoneEndpoint) }) @@ -124,8 +127,6 @@ var _ = Describe("ManilaScheduler controller", func() { When("manila-scheduler-config is ready", func() { BeforeEach(func() { DeferCleanup(th.DeleteInstance, CreateManilaScheduler(manilaTest.Instance, GetDefaultManilaSchedulerSpec())) - mariadb.SimulateMariaDBDatabaseCompleted(manilaTest.Instance) - mariadb.SimulateMariaDBAccountCompleted(manilaTest.Instance) th.SimulateJobSuccess(manilaTest.ManilaDBSync) keystone.SimulateKeystoneEndpointReady(manilaTest.ManilaKeystoneEndpoint) keystone.SimulateKeystoneEndpointReady(manilaTest.Instance) diff --git a/test/functional/manilashare_controller_test.go b/test/functional/manilashare_controller_test.go index cdf16aab..ccc6e3b6 100644 --- a/test/functional/manilashare_controller_test.go +++ b/test/functional/manilashare_controller_test.go @@ -53,10 +53,14 @@ var _ = Describe("ManilaShare controller", func() { }, ), ) - mariadb.CreateMariaDBDatabase(manilaTest.Instance.Namespace, manilaTest.Instance.Name, mariadbv1.MariaDBDatabaseSpec{}) - mariadb.CreateMariaDBAccount(manilaTest.Instance.Namespace, manilaTest.Instance.Name, mariadbv1.MariaDBAccountSpec{}) - mariadb.SimulateMariaDBAccountCompleted(manilaTest.Instance) - mariadb.SimulateMariaDBDatabaseCompleted(manilaTest.Instance) + mariadb.CreateMariaDBDatabase(manilaTest.ManilaDatabaseName.Namespace, manilaTest.ManilaDatabaseName.Name, mariadbv1.MariaDBDatabaseSpec{}) + + dbAccount, dbSecret := mariadb.CreateMariaDBAccountAndSecret(manilaTest.ManilaDatabaseAccount, mariadbv1.MariaDBAccountSpec{}) + DeferCleanup(k8sClient.Delete, ctx, dbAccount) + DeferCleanup(k8sClient.Delete, ctx, dbSecret) + + mariadb.SimulateMariaDBAccountCompleted(manilaTest.ManilaDatabaseAccount) + mariadb.SimulateMariaDBDatabaseCompleted(manilaTest.ManilaDatabaseName) }) When("ManilaShare CR is created", func() { @@ -106,8 +110,6 @@ var _ = Describe("ManilaShare controller", func() { infra.SimulateTransportURLReady(manilaTest.ManilaTransportURL) infra.SimulateMemcachedReady(manilaTest.ManilaMemcached) DeferCleanup(keystone.DeleteKeystoneAPI, keystone.CreateKeystoneAPI(namespace)) - mariadb.SimulateMariaDBDatabaseCompleted(manilaTest.Instance) - mariadb.SimulateMariaDBAccountCompleted(manilaTest.Instance) th.SimulateJobSuccess(manilaTest.ManilaDBSync) keystone.SimulateKeystoneEndpointReady(manilaTest.ManilaKeystoneEndpoint) }) @@ -134,8 +136,6 @@ var _ = Describe("ManilaShare controller", func() { infra.SimulateTransportURLReady(manilaTest.ManilaTransportURL) infra.SimulateMemcachedReady(manilaTest.ManilaMemcached) DeferCleanup(keystone.DeleteKeystoneAPI, keystone.CreateKeystoneAPI(namespace)) - mariadb.SimulateMariaDBDatabaseCompleted(manilaTest.Instance) - mariadb.SimulateMariaDBAccountCompleted(manilaTest.Instance) th.SimulateJobSuccess(manilaTest.ManilaDBSync) keystone.SimulateKeystoneEndpointReady(manilaTest.ManilaKeystoneEndpoint) }) @@ -178,8 +178,6 @@ var _ = Describe("ManilaShare controller", func() { infra.SimulateTransportURLReady(manilaTest.ManilaTransportURL) infra.SimulateMemcachedReady(manilaTest.ManilaMemcached) DeferCleanup(keystone.DeleteKeystoneAPI, keystone.CreateKeystoneAPI(namespace)) - mariadb.SimulateMariaDBDatabaseCompleted(manilaTest.Instance) - mariadb.SimulateMariaDBAccountCompleted(manilaTest.Instance) th.SimulateJobSuccess(manilaTest.ManilaDBSync) keystone.SimulateKeystoneEndpointReady(manilaTest.ManilaKeystoneEndpoint) }) diff --git a/test/kuttl/tests/manila-basic/01-assert.yaml b/test/kuttl/tests/manila-basic/01-assert.yaml index 328843c1..2550ae3f 100644 --- a/test/kuttl/tests/manila-basic/01-assert.yaml +++ b/test/kuttl/tests/manila-basic/01-assert.yaml @@ -15,7 +15,7 @@ spec: [DEFAULT] debug = true databaseInstance: openstack - databaseUser: manila + databaseAccount: manila manilaAPI: customServiceConfig: | [DEFAULT] @@ -42,7 +42,6 @@ spec: cephfs_cluster_name=ceph cephfs_protocol_helper_type=CEPHFS passwordSelectors: - database: ManilaDatabasePassword service: ManilaPassword preserveJobs: false rabbitMqClusterName: rabbitmq @@ -82,6 +81,10 @@ status: reason: Ready status: "True" type: ManilaShareReady + - message: MariaDBAccount creation complete + reason: Ready + status: "True" + type: MariaDBAccountReady - message: " Memcached instance has been provisioned" reason: Ready status: "True" diff --git a/test/kuttl/tests/manila-basic/02-assert.yaml b/test/kuttl/tests/manila-basic/02-assert.yaml index 64fa12d0..1e4e52aa 100644 --- a/test/kuttl/tests/manila-basic/02-assert.yaml +++ b/test/kuttl/tests/manila-basic/02-assert.yaml @@ -15,7 +15,7 @@ spec: [DEFAULT] debug = true databaseInstance: openstack - databaseUser: manila + databaseAccount: manila manilaAPI: customServiceConfig: | [DEFAULT] @@ -41,7 +41,6 @@ spec: cephfs_cluster_name=ceph cephfs_protocol_helper_type=CEPHFS passwordSelectors: - database: ManilaDatabasePassword service: ManilaPassword preserveJobs: false rabbitMqClusterName: rabbitmq @@ -81,6 +80,10 @@ status: reason: Ready status: "True" type: ManilaShareReady + - message: MariaDBAccount creation complete + reason: Ready + status: "True" + type: MariaDBAccountReady - message: " Memcached instance has been provisioned" reason: Ready status: "True" @@ -126,7 +129,6 @@ spec: databaseHostname: openstack.manila-kuttl-tests.svc databaseUser: manila passwordSelectors: - database: ManilaDatabasePassword service: ManilaPassword replicas: 3 resources: {} diff --git a/test/kuttl/tests/manila-basic/03-assert.yaml b/test/kuttl/tests/manila-basic/03-assert.yaml index 328843c1..2550ae3f 100644 --- a/test/kuttl/tests/manila-basic/03-assert.yaml +++ b/test/kuttl/tests/manila-basic/03-assert.yaml @@ -15,7 +15,7 @@ spec: [DEFAULT] debug = true databaseInstance: openstack - databaseUser: manila + databaseAccount: manila manilaAPI: customServiceConfig: | [DEFAULT] @@ -42,7 +42,6 @@ spec: cephfs_cluster_name=ceph cephfs_protocol_helper_type=CEPHFS passwordSelectors: - database: ManilaDatabasePassword service: ManilaPassword preserveJobs: false rabbitMqClusterName: rabbitmq @@ -82,6 +81,10 @@ status: reason: Ready status: "True" type: ManilaShareReady + - message: MariaDBAccount creation complete + reason: Ready + status: "True" + type: MariaDBAccountReady - message: " Memcached instance has been provisioned" reason: Ready status: "True" diff --git a/test/kuttl/tests/manila-multibackend/01-assert.yaml b/test/kuttl/tests/manila-multibackend/01-assert.yaml index a777270d..0ee12b8c 100644 --- a/test/kuttl/tests/manila-multibackend/01-assert.yaml +++ b/test/kuttl/tests/manila-multibackend/01-assert.yaml @@ -13,7 +13,7 @@ spec: [DEFAULT] debug = true databaseInstance: openstack - databaseUser: manila + databaseAccount: manila manilaAPI: customServiceConfig: | [DEFAULT] @@ -52,7 +52,6 @@ spec: cephfs_protocol_helper_type=NFS replicas: 0 passwordSelectors: - database: ManilaDatabasePassword service: ManilaPassword preserveJobs: false rabbitMqClusterName: rabbitmq @@ -92,6 +91,10 @@ status: reason: Ready status: "True" type: ManilaShareReady + - message: MariaDBAccount creation complete + reason: Ready + status: "True" + type: MariaDBAccountReady - message: " Memcached instance has been provisioned" reason: Ready status: "True" @@ -175,7 +178,6 @@ spec: databaseHostname: openstack.manila-kuttl-tests.svc databaseUser: manila passwordSelectors: - database: ManilaDatabasePassword service: ManilaPassword replicas: 1 resources: {} diff --git a/test/kuttl/tests/manila-multibackend/02-assert.yaml b/test/kuttl/tests/manila-multibackend/02-assert.yaml index 9fbc8693..901b0186 100644 --- a/test/kuttl/tests/manila-multibackend/02-assert.yaml +++ b/test/kuttl/tests/manila-multibackend/02-assert.yaml @@ -15,7 +15,7 @@ spec: [DEFAULT] debug = true databaseInstance: openstack - databaseUser: manila + databaseAccount: manila manilaAPI: customServiceConfig: | [DEFAULT] @@ -94,6 +94,10 @@ status: reason: Ready status: "True" type: ManilaShareReady + - message: MariaDBAccount creation complete + reason: Ready + status: "True" + type: MariaDBAccountReady - message: " Memcached instance has been provisioned" reason: Ready status: "True" diff --git a/test/kuttl/tests/manila-multibackend/03-assert.yaml b/test/kuttl/tests/manila-multibackend/03-assert.yaml index 99a469f6..69a50593 100644 --- a/test/kuttl/tests/manila-multibackend/03-assert.yaml +++ b/test/kuttl/tests/manila-multibackend/03-assert.yaml @@ -15,7 +15,7 @@ spec: [DEFAULT] debug = true databaseInstance: openstack - databaseUser: manila + databaseAccount: manila manilaAPI: customServiceConfig: | [DEFAULT] @@ -95,6 +95,10 @@ status: reason: Ready status: "True" type: ManilaShareReady + - message: MariaDBAccount creation complete + reason: Ready + status: "True" + type: MariaDBAccountReady - message: " Memcached instance has been provisioned" reason: Ready status: "True" diff --git a/test/kuttl/tests/manila-tls/03-assert.yaml b/test/kuttl/tests/manila-tls/03-assert.yaml index ae24caa9..7370883c 100644 --- a/test/kuttl/tests/manila-tls/03-assert.yaml +++ b/test/kuttl/tests/manila-tls/03-assert.yaml @@ -8,7 +8,7 @@ spec: [DEFAULT] debug = true databaseInstance: openstack - databaseUser: manila + databaseAccount: manila dbPurge: age: 30 schedule: 1 0 * * * @@ -64,7 +64,6 @@ spec: resources: {} memcachedInstance: memcached passwordSelectors: - database: ManilaDatabasePassword service: ManilaPassword preserveJobs: false rabbitMqClusterName: rabbitmq @@ -104,6 +103,10 @@ status: reason: Ready status: "True" type: ManilaShareReady + - message: MariaDBAccount creation complete + reason: Ready + status: "True" + type: MariaDBAccountReady - message: " Memcached instance has been provisioned" reason: Ready status: "True" @@ -193,7 +196,6 @@ spec: databaseHostname: openstack.manila-kuttl-tests.svc databaseUser: manila passwordSelectors: - database: ManilaDatabasePassword service: ManilaPassword replicas: 1 resources: {}