Skip to content

Commit 41f036f

Browse files
committed
Operator: remove default replicas setting from Deployment
Signed-off-by: Tommy Hughes <tohughes@redhat.com>
1 parent bb1cbea commit 41f036f

12 files changed

+17
-13
lines changed

infra/feast-operator/internal/controller/featurestore_controller_db_store_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ var _ = Describe("FeatureStore Controller - db storage services", func() {
437437
Namespace: objMeta.Namespace,
438438
}, deploy)
439439
Expect(err).NotTo(HaveOccurred())
440-
Expect(deploy.Spec.Replicas).To(Equal(&services.DefaultReplicas))
440+
Expect(deploy.Spec.Replicas).To(Equal(services.Int32Ptr(1)))
441441
Expect(controllerutil.HasControllerReference(deploy)).To(BeTrue())
442442
Expect(deploy.Spec.Template.Spec.Containers).To(HaveLen(4))
443443
svc := &corev1.Service{}

infra/feast-operator/internal/controller/featurestore_controller_ephemeral_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ var _ = Describe("FeatureStore Controller-Ephemeral services", func() {
206206
Namespace: objMeta.Namespace,
207207
}, deploy)
208208
Expect(err).NotTo(HaveOccurred())
209-
Expect(deploy.Spec.Replicas).To(Equal(&services.DefaultReplicas))
209+
Expect(deploy.Spec.Replicas).To(Equal(services.Int32Ptr(1)))
210210
Expect(controllerutil.HasControllerReference(deploy)).To(BeTrue())
211211
Expect(deploy.Spec.Template.Spec.Containers).To(HaveLen(4))
212212
svc := &corev1.Service{}

infra/feast-operator/internal/controller/featurestore_controller_kubernetes_auth_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ var _ = Describe("FeatureStore Controller-Kubernetes authorization", func() {
200200
Namespace: objMeta.Namespace,
201201
}, deploy)
202202
Expect(err).NotTo(HaveOccurred())
203-
Expect(deploy.Spec.Replicas).To(Equal(&services.DefaultReplicas))
203+
Expect(deploy.Spec.Replicas).To(Equal(services.Int32Ptr(1)))
204204
Expect(controllerutil.HasControllerReference(deploy)).To(BeTrue())
205205
Expect(deploy.Spec.Template.Spec.Containers).To(HaveLen(4))
206206
Expect(deploy.Spec.Template.Spec.Volumes).To(HaveLen(1))

infra/feast-operator/internal/controller/featurestore_controller_loglevel_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ var _ = Describe("FeatureStore Controller - Feast service LogLevel", func() {
171171
Namespace: objMeta.Namespace,
172172
}, deploy)
173173
Expect(err).NotTo(HaveOccurred())
174-
Expect(deploy.Spec.Replicas).To(Equal(&services.DefaultReplicas))
174+
Expect(deploy.Spec.Replicas).To(Equal(services.Int32Ptr(1)))
175175
Expect(controllerutil.HasControllerReference(deploy)).To(BeTrue())
176176
Expect(deploy.Spec.Template.Spec.Containers).To(HaveLen(4))
177177
command := services.GetRegistryContainer(*deploy).Command

infra/feast-operator/internal/controller/featurestore_controller_objectstore_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ var _ = Describe("FeatureStore Controller-Ephemeral services", func() {
183183
Namespace: objMeta.Namespace,
184184
}, deploy)
185185
Expect(err).NotTo(HaveOccurred())
186-
Expect(deploy.Spec.Replicas).To(Equal(&services.DefaultReplicas))
186+
Expect(deploy.Spec.Replicas).To(Equal(services.Int32Ptr(1)))
187187
Expect(controllerutil.HasControllerReference(deploy)).To(BeTrue())
188188
Expect(deploy.Spec.Template.Spec.InitContainers).To(HaveLen(1))
189189
Expect(deploy.Spec.Template.Spec.Containers).To(HaveLen(2))
@@ -279,7 +279,7 @@ var _ = Describe("FeatureStore Controller-Ephemeral services", func() {
279279
Namespace: objMeta.Namespace,
280280
}, deploy)
281281
Expect(err).NotTo(HaveOccurred())
282-
Expect(deploy.Spec.Replicas).To(Equal(&services.DefaultReplicas))
282+
Expect(deploy.Spec.Replicas).To(Equal(services.Int32Ptr(1)))
283283
Expect(controllerutil.HasControllerReference(deploy)).To(BeTrue())
284284
Expect(deploy.Spec.Template.Spec.Containers).To(HaveLen(2))
285285
Expect(services.GetRegistryContainer(*deploy)).NotTo(BeNil())

infra/feast-operator/internal/controller/featurestore_controller_oidc_auth_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ var _ = Describe("FeatureStore Controller-OIDC authorization", func() {
219219
Namespace: objMeta.Namespace,
220220
}, deploy)
221221
Expect(err).NotTo(HaveOccurred())
222-
Expect(deploy.Spec.Replicas).To(Equal(&services.DefaultReplicas))
222+
Expect(deploy.Spec.Replicas).To(Equal(services.Int32Ptr(1)))
223223
Expect(controllerutil.HasControllerReference(deploy)).To(BeTrue())
224224
Expect(deploy.Spec.Template.Spec.InitContainers).To(HaveLen(1))
225225
Expect(deploy.Spec.Template.Spec.Containers).To(HaveLen(4))

infra/feast-operator/internal/controller/featurestore_controller_pvc_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ var _ = Describe("FeatureStore Controller-Ephemeral services", func() {
281281
Namespace: objMeta.Namespace,
282282
}, deploy)
283283
Expect(err).NotTo(HaveOccurred())
284-
Expect(deploy.Spec.Replicas).To(Equal(&services.DefaultReplicas))
284+
Expect(deploy.Spec.Replicas).To(Equal(services.Int32Ptr(1)))
285285
Expect(controllerutil.HasControllerReference(deploy)).To(BeTrue())
286286
Expect(deploy.Spec.Template.Spec.Containers).To(HaveLen(3))
287287
Expect(deploy.Spec.Template.Spec.Volumes).To(HaveLen(3))

infra/feast-operator/internal/controller/featurestore_controller_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ var _ = Describe("FeatureStore Controller", func() {
201201
Namespace: objMeta.Namespace,
202202
}, deploy)
203203
Expect(err).NotTo(HaveOccurred())
204-
Expect(deploy.Spec.Replicas).To(Equal(&services.DefaultReplicas))
204+
Expect(deploy.Spec.Replicas).To(Equal(services.Int32Ptr(1)))
205205
Expect(controllerutil.HasControllerReference(deploy)).To(BeTrue())
206206
Expect(deploy.Spec.Template.Spec.ServiceAccountName).To(Equal(deploy.Name))
207207
Expect(deploy.Spec.Template.Spec.InitContainers).To(HaveLen(1))
@@ -650,7 +650,7 @@ var _ = Describe("FeatureStore Controller", func() {
650650
Namespace: objMeta.Namespace,
651651
}, deploy)
652652
Expect(err).NotTo(HaveOccurred())
653-
Expect(deploy.Spec.Replicas).To(Equal(&services.DefaultReplicas))
653+
Expect(deploy.Spec.Replicas).To(Equal(services.Int32Ptr(1)))
654654
Expect(controllerutil.HasControllerReference(deploy)).To(BeTrue())
655655
Expect(deploy.Spec.Template.Spec.ServiceAccountName).To(Equal(deploy.Name))
656656
Expect(deploy.Spec.Template.Spec.Containers).To(HaveLen(4))

infra/feast-operator/internal/controller/featurestore_controller_tls_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ var _ = Describe("FeatureStore Controller - Feast service TLS", func() {
188188
Namespace: objMeta.Namespace,
189189
}, deploy)
190190
Expect(err).NotTo(HaveOccurred())
191-
Expect(deploy.Spec.Replicas).To(Equal(&services.DefaultReplicas))
191+
Expect(deploy.Spec.Replicas).To(Equal(services.Int32Ptr(1)))
192192
Expect(controllerutil.HasControllerReference(deploy)).To(BeTrue())
193193
Expect(deploy.Spec.Template.Spec.Containers).To(HaveLen(4))
194194
svc := &corev1.Service{}

infra/feast-operator/internal/controller/services/services.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,9 +331,10 @@ func (feast *FeastServices) createPVC(pvcCreate *feastdevv1alpha1.PvcCreate, fea
331331
}
332332

333333
func (feast *FeastServices) setDeployment(deploy *appsv1.Deployment) error {
334+
replicas := deploy.Spec.Replicas
334335
deploy.Labels = feast.getLabels()
335336
deploy.Spec = appsv1.DeploymentSpec{
336-
Replicas: &DefaultReplicas,
337+
Replicas: replicas,
337338
Selector: metav1.SetAsLabelSelector(deploy.GetLabels()),
338339
Strategy: feast.getDeploymentStrategy(),
339340
Template: corev1.PodTemplateSpec{

0 commit comments

Comments
 (0)