From b8938d3c2bd108a2e6933ff97030a0f418bba77d Mon Sep 17 00:00:00 2001 From: Oliver Walsh Date: Wed, 20 Nov 2024 18:11:32 +0000 Subject: [PATCH] Set nodeSelector on jobs and allow empty nodeSelector Switch to a pointer for nodeSelector to allow different logic for empty vs unset --- api/v1beta1/common_types.go | 2 +- api/v1beta1/manila_types.go | 2 +- api/v1beta1/zz_generated.deepcopy.go | 20 ++- controllers/manila_controller.go | 23 +-- pkg/manila/cronjob.go | 5 +- pkg/manila/job.go | 4 + pkg/manilaapi/statefulset.go | 9 +- pkg/manilascheduler/statefulset.go | 9 +- pkg/manilashare/statefulset.go | 9 +- test/functional/base_test.go | 4 +- test/functional/manila_controller_test.go | 192 ++++++++++++++++++++++ 11 files changed, 248 insertions(+), 31 deletions(-) diff --git a/api/v1beta1/common_types.go b/api/v1beta1/common_types.go index b74f652c..e1baccf3 100644 --- a/api/v1beta1/common_types.go +++ b/api/v1beta1/common_types.go @@ -67,7 +67,7 @@ type ManilaServiceTemplate struct { // +kubebuilder:validation:Optional // NodeSelector to target subset of worker nodes running this service. Setting here overrides // any global NodeSelector settings within the Manila CR. - NodeSelector map[string]string `json:"nodeSelector,omitempty"` + NodeSelector *map[string]string `json:"nodeSelector,omitempty"` // +kubebuilder:validation:Optional // +kubebuilder:default="# add your customization here" diff --git a/api/v1beta1/manila_types.go b/api/v1beta1/manila_types.go index 6fb06e8e..35908099 100644 --- a/api/v1beta1/manila_types.go +++ b/api/v1beta1/manila_types.go @@ -111,7 +111,7 @@ type ManilaSpecBase struct { // NodeSelector to target subset of worker nodes running this service. Setting // NodeSelector here acts as a default value and can be overridden by service // specific NodeSelector Settings. - NodeSelector map[string]string `json:"nodeSelector,omitempty"` + NodeSelector *map[string]string `json:"nodeSelector,omitempty"` // +kubebuilder:validation:Optional // DBPurge parameters - diff --git a/api/v1beta1/zz_generated.deepcopy.go b/api/v1beta1/zz_generated.deepcopy.go index 4ca5ef62..6f491723 100644 --- a/api/v1beta1/zz_generated.deepcopy.go +++ b/api/v1beta1/zz_generated.deepcopy.go @@ -512,9 +512,13 @@ func (in *ManilaServiceTemplate) DeepCopyInto(out *ManilaServiceTemplate) { *out = *in if in.NodeSelector != nil { in, out := &in.NodeSelector, &out.NodeSelector - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val + *out = new(map[string]string) + if **in != nil { + in, out := *in, *out + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } } } if in.CustomServiceConfigSecrets != nil { @@ -744,9 +748,13 @@ func (in *ManilaSpecBase) DeepCopyInto(out *ManilaSpecBase) { } if in.NodeSelector != nil { in, out := &in.NodeSelector, &out.NodeSelector - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val + *out = new(map[string]string) + if **in != nil { + in, out := *in, *out + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } } } out.DBPurge = in.DBPurge diff --git a/controllers/manila_controller.go b/controllers/manila_controller.go index 71ad536f..f893042d 100644 --- a/controllers/manila_controller.go +++ b/controllers/manila_controller.go @@ -977,12 +977,13 @@ func (r *ManilaReconciler) apiDeploymentCreateOrUpdate(ctx context.Context, inst ServiceAccount: instance.RbacResourceName(), } + if apiSpec.NodeSelector == nil { + apiSpec.NodeSelector = instance.Spec.NodeSelector + } + op, err := controllerutil.CreateOrUpdate(ctx, r.Client, deployment, func() error { deployment.Spec = apiSpec - if len(deployment.Spec.NodeSelector) == 0 { - deployment.Spec.NodeSelector = instance.Spec.NodeSelector - } deployment.Spec.TransportURLSecret = instance.Status.TransportURLSecret err := controllerutil.SetControllerReference(instance, deployment, r.Scheme) @@ -1014,12 +1015,12 @@ func (r *ManilaReconciler) schedulerDeploymentCreateOrUpdate(ctx context.Context TLS: instance.Spec.ManilaAPI.TLS.Ca, } + if schedulerSpec.NodeSelector == nil { + schedulerSpec.NodeSelector = instance.Spec.NodeSelector + } + op, err := controllerutil.CreateOrUpdate(ctx, r.Client, deployment, func() error { deployment.Spec = schedulerSpec - - if len(deployment.Spec.NodeSelector) == 0 { - deployment.Spec.NodeSelector = instance.Spec.NodeSelector - } deployment.Spec.TransportURLSecret = instance.Status.TransportURLSecret err := controllerutil.SetControllerReference(instance, deployment, r.Scheme) @@ -1061,12 +1062,12 @@ func (r *ManilaReconciler) shareDeploymentCreateOrUpdate( TLS: instance.Spec.ManilaAPI.TLS.Ca, } + if shareSpec.NodeSelector == nil { + shareSpec.NodeSelector = instance.Spec.NodeSelector + } + op, err := controllerutil.CreateOrUpdate(ctx, r.Client, deployment, func() error { deployment.Spec = shareSpec - - if len(deployment.Spec.NodeSelector) == 0 { - deployment.Spec.NodeSelector = instance.Spec.NodeSelector - } deployment.Spec.TransportURLSecret = instance.Status.TransportURLSecret err := controllerutil.SetControllerReference(instance, deployment, r.Scheme) diff --git a/pkg/manila/cronjob.go b/pkg/manila/cronjob.go index bc7b99e9..b29bf01a 100644 --- a/pkg/manila/cronjob.go +++ b/pkg/manila/cronjob.go @@ -124,8 +124,9 @@ func CronJob( }, }, } - if instance.Spec.NodeSelector != nil && len(instance.Spec.NodeSelector) > 0 { - cronjob.Spec.JobTemplate.Spec.Template.Spec.NodeSelector = instance.Spec.NodeSelector + + if instance.Spec.NodeSelector != nil { + cronjob.Spec.JobTemplate.Spec.Template.Spec.NodeSelector = *instance.Spec.NodeSelector } return cronjob diff --git a/pkg/manila/job.go b/pkg/manila/job.go index 51da78b1..e9d07fa4 100644 --- a/pkg/manila/job.go +++ b/pkg/manila/job.go @@ -2,6 +2,7 @@ package manila import ( "fmt" + "github.com/openstack-k8s-operators/lib-common/modules/common/env" manilav1 "github.com/openstack-k8s-operators/manila-operator/api/v1beta1" batchv1 "k8s.io/api/batch/v1" @@ -119,5 +120,8 @@ func Job( // Setting TTL to delete the job after it has completed job.Spec.TTLSecondsAfterFinished = ttl } + if instance.Spec.NodeSelector != nil { + job.Spec.Template.Spec.NodeSelector = *instance.Spec.NodeSelector + } return job } diff --git a/pkg/manilaapi/statefulset.go b/pkg/manilaapi/statefulset.go index 82daf2b1..d7915167 100644 --- a/pkg/manilaapi/statefulset.go +++ b/pkg/manilaapi/statefulset.go @@ -163,13 +163,16 @@ func StatefulSet( LivenessProbe: livenessProbe, }, }, - Affinity: manila.GetPodAffinity(ComponentName), - NodeSelector: instance.Spec.NodeSelector, - Volumes: volumes, + Affinity: manila.GetPodAffinity(ComponentName), + Volumes: volumes, }, }, }, } + if instance.Spec.NodeSelector != nil { + statefulset.Spec.Template.Spec.NodeSelector = *instance.Spec.NodeSelector + } + return statefulset, nil } diff --git a/pkg/manilascheduler/statefulset.go b/pkg/manilascheduler/statefulset.go index 1f4f7ea7..0fbd0a19 100644 --- a/pkg/manilascheduler/statefulset.go +++ b/pkg/manilascheduler/statefulset.go @@ -131,13 +131,16 @@ func StatefulSet( VolumeMounts: volumeMounts, }, }, - Affinity: manila.GetPodAffinity(ComponentName), - NodeSelector: instance.Spec.NodeSelector, - Volumes: volumes, + Affinity: manila.GetPodAffinity(ComponentName), + Volumes: volumes, }, }, }, } + if instance.Spec.NodeSelector != nil { + statefulset.Spec.Template.Spec.NodeSelector = *instance.Spec.NodeSelector + } + return statefulset } diff --git a/pkg/manilashare/statefulset.go b/pkg/manilashare/statefulset.go index bb3474e1..38bffadb 100644 --- a/pkg/manilashare/statefulset.go +++ b/pkg/manilashare/statefulset.go @@ -149,13 +149,16 @@ func StatefulSet( VolumeMounts: volumeMounts, }, }, - Affinity: manila.GetPodAffinity(ComponentName), - NodeSelector: instance.Spec.NodeSelector, - Volumes: volumes, + Affinity: manila.GetPodAffinity(ComponentName), + Volumes: volumes, }, }, }, } + if instance.Spec.NodeSelector != nil { + statefulset.Spec.Template.Spec.NodeSelector = *instance.Spec.NodeSelector + } + return statefulset } diff --git a/test/functional/base_test.go b/test/functional/base_test.go index ad9852e6..abfba06f 100644 --- a/test/functional/base_test.go +++ b/test/functional/base_test.go @@ -73,7 +73,9 @@ func GetDefaultManilaSpec() map[string]interface{} { "secret": SecretName, "manilaAPI": GetDefaultManilaAPISpec(), "manilaScheduler": GetDefaultManilaSchedulerSpec(), - "manilaShare": GetDefaultManilaShareSpec(), + "manilaShares": map[string]interface{}{ + "share0": GetDefaultManilaShareSpec(), + }, } } diff --git a/test/functional/manila_controller_test.go b/test/functional/manila_controller_test.go index 5fa75763..8258bb60 100644 --- a/test/functional/manila_controller_test.go +++ b/test/functional/manila_controller_test.go @@ -665,6 +665,198 @@ var _ = Describe("Manila controller", func() { }) }) + When("A Manila is created with nodeSelector", func() { + BeforeEach(func() { + spec := GetDefaultManilaSpec() + spec["nodeSelector"] = map[string]interface{}{ + "foo": "bar", + } + DeferCleanup(th.DeleteInstance, CreateManila(manilaTest.Instance, spec)) + DeferCleanup(k8sClient.Delete, ctx, CreateManilaMessageBusSecret(manilaTest.Instance.Namespace, manilaTest.RabbitmqSecretName)) + 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(manilaTest.ManilaDatabaseAccount) + th.SimulateJobSuccess(manilaTest.ManilaDBSync) + keystone.SimulateKeystoneServiceReady(manilaTest.Instance) + keystone.SimulateKeystoneEndpointReady(manilaTest.ManilaKeystoneEndpoint) + th.SimulateStatefulSetReplicaReady(manilaTest.ManilaAPI) + th.SimulateStatefulSetReplicaReady(manilaTest.ManilaScheduler) + th.SimulateStatefulSetReplicaReady(manilaTest.ManilaShares[0]) + }) + + It("sets nodeSelector in resource specs", func() { + Eventually(func(g Gomega) { + g.Expect(th.GetStatefulSet(manilaTest.ManilaAPI).Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo": "bar"})) + g.Expect(th.GetStatefulSet(manilaTest.ManilaScheduler).Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo": "bar"})) + g.Expect(th.GetStatefulSet(manilaTest.ManilaShares[0]).Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo": "bar"})) + g.Expect(th.GetJob(manilaTest.ManilaDBSync).Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo": "bar"})) + g.Expect(GetCronJob(manilaTest.DBPurgeCronJob).Spec.JobTemplate.Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo": "bar"})) + }, timeout, interval).Should(Succeed()) + }) + + It("updates nodeSelector in resource specs when changed", func() { + Eventually(func(g Gomega) { + g.Expect(th.GetStatefulSet(manilaTest.ManilaAPI).Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo": "bar"})) + g.Expect(th.GetStatefulSet(manilaTest.ManilaScheduler).Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo": "bar"})) + g.Expect(th.GetStatefulSet(manilaTest.ManilaShares[0]).Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo": "bar"})) + g.Expect(th.GetJob(manilaTest.ManilaDBSync).Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo": "bar"})) + g.Expect(GetCronJob(manilaTest.DBPurgeCronJob).Spec.JobTemplate.Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo": "bar"})) + }, timeout, interval).Should(Succeed()) + + Eventually(func(g Gomega) { + manila := GetManila(manilaName) + newNodeSelector := map[string]string{ + "foo2": "bar2", + } + manila.Spec.NodeSelector = &newNodeSelector + g.Expect(k8sClient.Update(ctx, manila)).Should(Succeed()) + }, timeout, interval).Should(Succeed()) + + Eventually(func(g Gomega) { + th.SimulateJobSuccess(manilaTest.ManilaDBSync) + g.Expect(th.GetStatefulSet(manilaTest.ManilaAPI).Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo2": "bar2"})) + g.Expect(th.GetStatefulSet(manilaTest.ManilaScheduler).Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo2": "bar2"})) + g.Expect(th.GetStatefulSet(manilaTest.ManilaShares[0]).Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo2": "bar2"})) + g.Expect(th.GetJob(manilaTest.ManilaDBSync).Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo2": "bar2"})) + g.Expect(GetCronJob(manilaTest.DBPurgeCronJob).Spec.JobTemplate.Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo2": "bar2"})) + }, timeout, interval).Should(Succeed()) + }) + + It("removes nodeSelector from resource specs when cleared", func() { + Eventually(func(g Gomega) { + g.Expect(th.GetStatefulSet(manilaTest.ManilaAPI).Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo": "bar"})) + g.Expect(th.GetStatefulSet(manilaTest.ManilaScheduler).Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo": "bar"})) + g.Expect(th.GetStatefulSet(manilaTest.ManilaShares[0]).Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo": "bar"})) + g.Expect(th.GetJob(manilaTest.ManilaDBSync).Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo": "bar"})) + g.Expect(GetCronJob(manilaTest.DBPurgeCronJob).Spec.JobTemplate.Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo": "bar"})) + }, timeout, interval).Should(Succeed()) + + Eventually(func(g Gomega) { + manila := GetManila(manilaName) + emptyNodeSelector := map[string]string{} + manila.Spec.NodeSelector = &emptyNodeSelector + g.Expect(k8sClient.Update(ctx, manila)).Should(Succeed()) + }, timeout, interval).Should(Succeed()) + + Eventually(func(g Gomega) { + th.SimulateJobSuccess(manilaTest.ManilaDBSync) + g.Expect(th.GetStatefulSet(manilaTest.ManilaAPI).Spec.Template.Spec.NodeSelector).To(BeNil()) + g.Expect(th.GetStatefulSet(manilaTest.ManilaScheduler).Spec.Template.Spec.NodeSelector).To(BeNil()) + g.Expect(th.GetStatefulSet(manilaTest.ManilaShares[0]).Spec.Template.Spec.NodeSelector).To(BeNil()) + g.Expect(th.GetJob(manilaTest.ManilaDBSync).Spec.Template.Spec.NodeSelector).To(BeNil()) + g.Expect(GetCronJob(manilaTest.DBPurgeCronJob).Spec.JobTemplate.Spec.Template.Spec.NodeSelector).To(BeNil()) + }, timeout, interval).Should(Succeed()) + }) + + It("removes nodeSelector from resource specs when nilled", func() { + Eventually(func(g Gomega) { + g.Expect(th.GetStatefulSet(manilaTest.ManilaAPI).Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo": "bar"})) + g.Expect(th.GetStatefulSet(manilaTest.ManilaScheduler).Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo": "bar"})) + g.Expect(th.GetStatefulSet(manilaTest.ManilaShares[0]).Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo": "bar"})) + g.Expect(th.GetJob(manilaTest.ManilaDBSync).Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo": "bar"})) + g.Expect(GetCronJob(manilaTest.DBPurgeCronJob).Spec.JobTemplate.Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo": "bar"})) + }, timeout, interval).Should(Succeed()) + + Eventually(func(g Gomega) { + manila := GetManila(manilaName) + manila.Spec.NodeSelector = nil + g.Expect(k8sClient.Update(ctx, manila)).Should(Succeed()) + }, timeout, interval).Should(Succeed()) + + Eventually(func(g Gomega) { + th.SimulateJobSuccess(manilaTest.ManilaDBSync) + g.Expect(th.GetStatefulSet(manilaTest.ManilaAPI).Spec.Template.Spec.NodeSelector).To(BeNil()) + g.Expect(th.GetStatefulSet(manilaTest.ManilaScheduler).Spec.Template.Spec.NodeSelector).To(BeNil()) + g.Expect(th.GetStatefulSet(manilaTest.ManilaShares[0]).Spec.Template.Spec.NodeSelector).To(BeNil()) + g.Expect(th.GetJob(manilaTest.ManilaDBSync).Spec.Template.Spec.NodeSelector).To(BeNil()) + g.Expect(GetCronJob(manilaTest.DBPurgeCronJob).Spec.JobTemplate.Spec.Template.Spec.NodeSelector).To(BeNil()) + }, timeout, interval).Should(Succeed()) + }) + + It("allows nodeSelector service override", func() { + Eventually(func(g Gomega) { + g.Expect(th.GetStatefulSet(manilaTest.ManilaAPI).Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo": "bar"})) + g.Expect(th.GetStatefulSet(manilaTest.ManilaScheduler).Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo": "bar"})) + g.Expect(th.GetStatefulSet(manilaTest.ManilaShares[0]).Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo": "bar"})) + g.Expect(th.GetJob(manilaTest.ManilaDBSync).Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo": "bar"})) + g.Expect(GetCronJob(manilaTest.DBPurgeCronJob).Spec.JobTemplate.Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo": "bar"})) + }, timeout, interval).Should(Succeed()) + + Eventually(func(g Gomega) { + manila := GetManila(manilaName) + apiNodeSelector := map[string]string{ + "foo": "api", + } + manila.Spec.ManilaAPI.NodeSelector = &apiNodeSelector + schedulerNodeSelector := map[string]string{ + "foo": "scheduler", + } + manila.Spec.ManilaScheduler.NodeSelector = &schedulerNodeSelector + shareNodeSelector := map[string]string{ + "foo": "share", + } + share := manila.Spec.ManilaShares["share0"] + share.NodeSelector = &shareNodeSelector + manila.Spec.ManilaShares["share0"] = share + g.Expect(k8sClient.Update(ctx, manila)).Should(Succeed()) + }, timeout, interval).Should(Succeed()) + + Eventually(func(g Gomega) { + th.SimulateJobSuccess(manilaTest.ManilaDBSync) + g.Expect(th.GetStatefulSet(manilaTest.ManilaAPI).Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo": "api"})) + g.Expect(th.GetStatefulSet(manilaTest.ManilaScheduler).Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo": "scheduler"})) + g.Expect(th.GetStatefulSet(manilaTest.ManilaShares[0]).Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo": "share"})) + g.Expect(th.GetJob(manilaTest.ManilaDBSync).Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo": "bar"})) + g.Expect(GetCronJob(manilaTest.DBPurgeCronJob).Spec.JobTemplate.Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo": "bar"})) + }, timeout, interval).Should(Succeed()) + }) + + It("allows nodeSelector service override to empty", func() { + Eventually(func(g Gomega) { + g.Expect(th.GetStatefulSet(manilaTest.ManilaAPI).Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo": "bar"})) + g.Expect(th.GetStatefulSet(manilaTest.ManilaScheduler).Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo": "bar"})) + g.Expect(th.GetStatefulSet(manilaTest.ManilaShares[0]).Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo": "bar"})) + g.Expect(th.GetJob(manilaTest.ManilaDBSync).Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo": "bar"})) + g.Expect(GetCronJob(manilaTest.DBPurgeCronJob).Spec.JobTemplate.Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo": "bar"})) + }, timeout, interval).Should(Succeed()) + + Eventually(func(g Gomega) { + manila := GetManila(manilaName) + apiNodeSelector := map[string]string{} + manila.Spec.ManilaAPI.NodeSelector = &apiNodeSelector + schedulerNodeSelector := map[string]string{} + manila.Spec.ManilaScheduler.NodeSelector = &schedulerNodeSelector + shareNodeSelector := map[string]string{} + share := manila.Spec.ManilaShares["share0"] + share.NodeSelector = &shareNodeSelector + manila.Spec.ManilaShares["share0"] = share + g.Expect(k8sClient.Update(ctx, manila)).Should(Succeed()) + }, timeout, interval).Should(Succeed()) + + Eventually(func(g Gomega) { + th.SimulateJobSuccess(manilaTest.ManilaDBSync) + g.Expect(th.GetStatefulSet(manilaTest.ManilaAPI).Spec.Template.Spec.NodeSelector).To(BeNil()) + g.Expect(th.GetStatefulSet(manilaTest.ManilaScheduler).Spec.Template.Spec.NodeSelector).To(BeNil()) + g.Expect(th.GetStatefulSet(manilaTest.ManilaShares[0]).Spec.Template.Spec.NodeSelector).To(BeNil()) + g.Expect(th.GetJob(manilaTest.ManilaDBSync).Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo": "bar"})) + g.Expect(GetCronJob(manilaTest.DBPurgeCronJob).Spec.JobTemplate.Spec.Template.Spec.NodeSelector).To(Equal(map[string]string{"foo": "bar"})) + }, timeout, interval).Should(Succeed()) + }) + }) + // 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.