From d951cec2e6d7f104bfcad877d060e44c71d59363 Mon Sep 17 00:00:00 2001 From: Shane Date: Tue, 19 Nov 2024 10:56:10 +0800 Subject: [PATCH 01/10] fix and optimize all checkRepliacas code Signed-off-by: Shane --- apis/keda/v1alpha1/scaledobject_types.go | 55 ++++++++++++++++++---- apis/keda/v1alpha1/scaledobject_webhook.go | 2 +- controllers/keda/hpa.go | 13 +++++ 3 files changed, 60 insertions(+), 10 deletions(-) diff --git a/apis/keda/v1alpha1/scaledobject_types.go b/apis/keda/v1alpha1/scaledobject_types.go index 37c5e640963..1d6fed9d428 100644 --- a/apis/keda/v1alpha1/scaledobject_types.go +++ b/apis/keda/v1alpha1/scaledobject_types.go @@ -239,13 +239,19 @@ func (so *ScaledObject) IsUsingModifiers() bool { // getHPAMinReplicas returns MinReplicas based on definition in ScaledObject or default value if not defined func (so *ScaledObject) GetHPAMinReplicas() *int32 { - if so.Spec.MinReplicaCount != nil && *so.Spec.MinReplicaCount > 0 { + if so.Spec.MinReplicaCount != nil { return so.Spec.MinReplicaCount } tmp := defaultHPAMinReplicas return &tmp } +// GetDefaultHPAMinReplicas returns defaultHPAMinReplicas +func (so *ScaledObject) GetDefaultHPAMinReplicas() *int32 { + tmp := defaultHPAMinReplicas + return &tmp +} + // getHPAMaxReplicas returns MaxReplicas based on definition in ScaledObject or default value if not defined func (so *ScaledObject) GetHPAMaxReplicas() int32 { if so.Spec.MaxReplicaCount != nil { @@ -254,21 +260,52 @@ func (so *ScaledObject) GetHPAMaxReplicas() int32 { return defaultHPAMaxReplicas } +// GetDefaultHPAMaxReplicas returns defaultHPAMaxReplicas +func (so *ScaledObject) GetDefaultHPAMaxReplicas() int32 { + return defaultHPAMaxReplicas +} + +// CheckReplicasNotNegative checks that Min/Max ReplicaCount defined in ScaledObject are not negative +func (so *ScaledObject) CheckReplicasNotNegative(replicas ...int32) bool { + for _, replica := range replicas { + if replica < 0 { + return false + } + } + return true +} + +// GetIdleReplicasIfDefined returns bool based on whether idleRelicas is defined +func (so *ScaledObject) GetIdleReplicasIfDefined() bool { + if so.Spec.IdleReplicaCount == nil { + return false + } else { + return true + } +} + // checkReplicaCountBoundsAreValid checks that Idle/Min/Max ReplicaCount defined in ScaledObject are correctly specified // i.e. that Min is not greater than Max or Idle greater or equal to Min func CheckReplicaCountBoundsAreValid(scaledObject *ScaledObject) error { - min := int32(0) - if scaledObject.Spec.MinReplicaCount != nil { - min = *scaledObject.GetHPAMinReplicas() + minReplicas := *scaledObject.GetHPAMinReplicas() + maxReplicas := scaledObject.GetHPAMaxReplicas() + idleReplicasDefined := scaledObject.GetIdleReplicasIfDefined() + var idleReplicas *int32 = scaledObject.Spec.IdleReplicaCount + + if !scaledObject.CheckReplicasNotNegative(minReplicas, maxReplicas) { + return fmt.Errorf("MinReplicaCount=%d, MaxReplicaCount=%d must not be negative", minReplicas, maxReplicas) + } + + if idleReplicasDefined && *idleReplicas < 0 { + return fmt.Errorf("IdleReplicaCount=%d must not be negative", *idleReplicas) } - max := scaledObject.GetHPAMaxReplicas() - if min > max { - return fmt.Errorf("MinReplicaCount=%d must be less than MaxReplicaCount=%d", min, max) + if minReplicas > maxReplicas { + return fmt.Errorf("MinReplicaCount=%d must not be greater than MaxReplicaCount=%d", minReplicas, maxReplicas) } - if scaledObject.Spec.IdleReplicaCount != nil && *scaledObject.Spec.IdleReplicaCount >= min { - return fmt.Errorf("IdleReplicaCount=%d must be less than MinReplicaCount=%d", *scaledObject.Spec.IdleReplicaCount, min) + if idleReplicasDefined && *idleReplicas >= minReplicas { + return fmt.Errorf("IdleReplicaCount=%d must be less than MinReplicaCount=%d", *scaledObject.Spec.IdleReplicaCount, minReplicas) } return nil diff --git a/apis/keda/v1alpha1/scaledobject_webhook.go b/apis/keda/v1alpha1/scaledobject_webhook.go index 41bd0355596..e4583730b15 100644 --- a/apis/keda/v1alpha1/scaledobject_webhook.go +++ b/apis/keda/v1alpha1/scaledobject_webhook.go @@ -184,7 +184,7 @@ func verifyReplicaCount(incomingSo *ScaledObject, action string, _ bool) error { scaledobjectlog.WithValues("name", incomingSo.Name).Error(err, "validation error") metricscollector.RecordScaledObjectValidatingErrors(incomingSo.Namespace, action, "incorrect-replicas") } - return nil + return err } func verifyFallback(incomingSo *ScaledObject, action string, _ bool) error { diff --git a/controllers/keda/hpa.go b/controllers/keda/hpa.go index 5fb2c835eb7..88f794955f2 100644 --- a/controllers/keda/hpa.go +++ b/controllers/keda/hpa.go @@ -102,6 +102,19 @@ func (r *ScaledObjectReconciler) newHPAForScaledObject(ctx context.Context, logg minReplicas := scaledObject.GetHPAMinReplicas() maxReplicas := scaledObject.GetHPAMaxReplicas() + if *minReplicas == 0 { + minReplicas = scaledObject.GetDefaultHPAMinReplicas() + } + + if maxReplicas == 0 { + maxReplicas = scaledObject.GetDefaultHPAMaxReplicas() + } + + if *minReplicas < 0 || maxReplicas < 0 { + err := fmt.Errorf("MinReplicaCount=%d and MaxReplicaCount=%d must not be negative", minReplicas, maxReplicas) + return nil, err + } + pausedCount, err := executor.GetPausedReplicaCount(scaledObject) if err != nil { return nil, err From e3cb4792a8d693a3497a3d7e543bd1d26d0ba04b Mon Sep 17 00:00:00 2001 From: Shane Date: Tue, 19 Nov 2024 11:31:06 +0800 Subject: [PATCH 02/10] add changelog Signed-off-by: Shane --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dbba7b57a05..3887dac7287 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -58,7 +58,7 @@ To learn more about active deprecations, we recommend checking [GitHub Discussio ### New -- TODO ([#XXX](https://github.com/kedacore/keda/issues/XXX)) +- **General**: Fix and optimize all webhook checkReplicas code ([#6344](https://github.com/kedacore/keda/pull/6344)) #### Experimental From 59079d881cf49c7f33033c7ac09deded5dd13a53 Mon Sep 17 00:00:00 2001 From: Shane Date: Tue, 19 Nov 2024 11:53:11 +0800 Subject: [PATCH 03/10] change some logic and variable name Signed-off-by: Shane --- apis/keda/v1alpha1/scaledobject_types.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/apis/keda/v1alpha1/scaledobject_types.go b/apis/keda/v1alpha1/scaledobject_types.go index 1d6fed9d428..e40da6c51b2 100644 --- a/apis/keda/v1alpha1/scaledobject_types.go +++ b/apis/keda/v1alpha1/scaledobject_types.go @@ -277,20 +277,17 @@ func (so *ScaledObject) CheckReplicasNotNegative(replicas ...int32) bool { // GetIdleReplicasIfDefined returns bool based on whether idleRelicas is defined func (so *ScaledObject) GetIdleReplicasIfDefined() bool { - if so.Spec.IdleReplicaCount == nil { - return false - } else { - return true - } + return so.Spec.IdleReplicaCount != nil } // checkReplicaCountBoundsAreValid checks that Idle/Min/Max ReplicaCount defined in ScaledObject are correctly specified // i.e. that Min is not greater than Max or Idle greater or equal to Min func CheckReplicaCountBoundsAreValid(scaledObject *ScaledObject) error { + var idleReplicas *int32 minReplicas := *scaledObject.GetHPAMinReplicas() maxReplicas := scaledObject.GetHPAMaxReplicas() idleReplicasDefined := scaledObject.GetIdleReplicasIfDefined() - var idleReplicas *int32 = scaledObject.Spec.IdleReplicaCount + idleReplicas = scaledObject.Spec.IdleReplicaCount if !scaledObject.CheckReplicasNotNegative(minReplicas, maxReplicas) { return fmt.Errorf("MinReplicaCount=%d, MaxReplicaCount=%d must not be negative", minReplicas, maxReplicas) From 4299fd63a04e9cb06cd9ec3c15944ac775ea203c Mon Sep 17 00:00:00 2001 From: Shane Date: Sun, 24 Nov 2024 19:59:34 +0800 Subject: [PATCH 04/10] Update CHANGELOG.md change changelog Signed-off-by: Shane --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3887dac7287..c012bc5ee71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -58,7 +58,8 @@ To learn more about active deprecations, we recommend checking [GitHub Discussio ### New -- **General**: Fix and optimize all webhook checkReplicas code ([#6344](https://github.com/kedacore/keda/pull/6344)) +- **General**: Optimize all webhook checkReplicas code ([#6344](https://github.com/kedacore/keda/pull/6344)) +-**General**: Introduce new NSQ scaler ([#3281](https://github.com/kedacore/keda/issues/3281)) #### Experimental From 5d80f1cdc17701e31d63541eb0f0302d4e658458 Mon Sep 17 00:00:00 2001 From: Shane Date: Tue, 10 Dec 2024 09:09:54 +0800 Subject: [PATCH 05/10] revise code Signed-off-by: Shane --- apis/keda/v1alpha1/scaledobject_types.go | 40 +++++++----------------- controllers/keda/hpa.go | 4 +-- 2 files changed, 14 insertions(+), 30 deletions(-) diff --git a/apis/keda/v1alpha1/scaledobject_types.go b/apis/keda/v1alpha1/scaledobject_types.go index e40da6c51b2..e40edec483f 100644 --- a/apis/keda/v1alpha1/scaledobject_types.go +++ b/apis/keda/v1alpha1/scaledobject_types.go @@ -246,12 +246,6 @@ func (so *ScaledObject) GetHPAMinReplicas() *int32 { return &tmp } -// GetDefaultHPAMinReplicas returns defaultHPAMinReplicas -func (so *ScaledObject) GetDefaultHPAMinReplicas() *int32 { - tmp := defaultHPAMinReplicas - return &tmp -} - // getHPAMaxReplicas returns MaxReplicas based on definition in ScaledObject or default value if not defined func (so *ScaledObject) GetHPAMaxReplicas() int32 { if so.Spec.MaxReplicaCount != nil { @@ -260,24 +254,15 @@ func (so *ScaledObject) GetHPAMaxReplicas() int32 { return defaultHPAMaxReplicas } -// GetDefaultHPAMaxReplicas returns defaultHPAMaxReplicas -func (so *ScaledObject) GetDefaultHPAMaxReplicas() int32 { - return defaultHPAMaxReplicas -} - -// CheckReplicasNotNegative checks that Min/Max ReplicaCount defined in ScaledObject are not negative -func (so *ScaledObject) CheckReplicasNotNegative(replicas ...int32) bool { - for _, replica := range replicas { - if replica < 0 { - return false - } - } - return true +// GetDefaultHPAMinReplicas returns defaultHPAMinReplicas +func GetDefaultHPAMinReplicas() *int32 { + tmp := defaultHPAMinReplicas + return &tmp } -// GetIdleReplicasIfDefined returns bool based on whether idleRelicas is defined -func (so *ScaledObject) GetIdleReplicasIfDefined() bool { - return so.Spec.IdleReplicaCount != nil +// GetDefaultHPAMaxReplicas returns defaultHPAMaxReplicas +func GetDefaultHPAMaxReplicas() int32 { + return defaultHPAMaxReplicas } // checkReplicaCountBoundsAreValid checks that Idle/Min/Max ReplicaCount defined in ScaledObject are correctly specified @@ -286,22 +271,21 @@ func CheckReplicaCountBoundsAreValid(scaledObject *ScaledObject) error { var idleReplicas *int32 minReplicas := *scaledObject.GetHPAMinReplicas() maxReplicas := scaledObject.GetHPAMaxReplicas() - idleReplicasDefined := scaledObject.GetIdleReplicasIfDefined() idleReplicas = scaledObject.Spec.IdleReplicaCount - if !scaledObject.CheckReplicasNotNegative(minReplicas, maxReplicas) { - return fmt.Errorf("MinReplicaCount=%d, MaxReplicaCount=%d must not be negative", minReplicas, maxReplicas) + if scaledObject.Spec.IdleReplicaCount != nil && *idleReplicas < 0 { + return fmt.Errorf("IdleReplicaCount=%d must not be negative", *idleReplicas) } - if idleReplicasDefined && *idleReplicas < 0 { - return fmt.Errorf("IdleReplicaCount=%d must not be negative", *idleReplicas) + if minReplicas < 0 { + return fmt.Errorf("MinReplicaCount=%d must not be negative", minReplicas) } if minReplicas > maxReplicas { return fmt.Errorf("MinReplicaCount=%d must not be greater than MaxReplicaCount=%d", minReplicas, maxReplicas) } - if idleReplicasDefined && *idleReplicas >= minReplicas { + if scaledObject.Spec.IdleReplicaCount != nil && *idleReplicas >= minReplicas { return fmt.Errorf("IdleReplicaCount=%d must be less than MinReplicaCount=%d", *scaledObject.Spec.IdleReplicaCount, minReplicas) } diff --git a/controllers/keda/hpa.go b/controllers/keda/hpa.go index 88f794955f2..9939f0f763e 100644 --- a/controllers/keda/hpa.go +++ b/controllers/keda/hpa.go @@ -103,11 +103,11 @@ func (r *ScaledObjectReconciler) newHPAForScaledObject(ctx context.Context, logg maxReplicas := scaledObject.GetHPAMaxReplicas() if *minReplicas == 0 { - minReplicas = scaledObject.GetDefaultHPAMinReplicas() + minReplicas = kedav1alpha1.GetDefaultHPAMinReplicas() } if maxReplicas == 0 { - maxReplicas = scaledObject.GetDefaultHPAMaxReplicas() + maxReplicas = kedav1alpha1.GetDefaultHPAMaxReplicas() } if *minReplicas < 0 || maxReplicas < 0 { From 55120ac85ff298a506b7762ab7abe2bee9ae1abb Mon Sep 17 00:00:00 2001 From: Shane Date: Tue, 10 Dec 2024 09:45:35 +0800 Subject: [PATCH 06/10] add test case Signed-off-by: Shane --- .../v1alpha1/scaledobject_webhook_test.go | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/apis/keda/v1alpha1/scaledobject_webhook_test.go b/apis/keda/v1alpha1/scaledobject_webhook_test.go index e30404d16c4..f00bdb90f8e 100644 --- a/apis/keda/v1alpha1/scaledobject_webhook_test.go +++ b/apis/keda/v1alpha1/scaledobject_webhook_test.go @@ -1048,6 +1048,91 @@ var _ = It("should validate the so creation with ScalingModifiers.Formula - doub }).ShouldNot(HaveOccurred()) }) +var _ = It("shouldn't validate negative minreplicacount", func() { + + namespaceName := "minreplicas-invalid" + namespace := createNamespace(namespaceName) + + err := k8sClient.Create(context.Background(), namespace) + Expect(err).ToNot(HaveOccurred()) + + workload := createDeployment(namespaceName, false, false) + + err = k8sClient.Create(context.Background(), workload) + Expect(err).ToNot(HaveOccurred()) + + so := createScaledObject(soName, namespaceName, workloadName, "apps/v1", "Deployment", false, map[string]string{}, "") + so.Spec.MinReplicaCount = ptr.To[int32](-5) + + Eventually(func() error { + return k8sClient.Create(context.Background(), so) + }).Should(HaveOccurred()) +}) + +var _ = It("shouldn't validate minreplicacount greater than maxreplicacount", func() { + + namespaceName := "empty-triggers-set" + namespace := createNamespace(namespaceName) + + err := k8sClient.Create(context.Background(), namespace) + Expect(err).ToNot(HaveOccurred()) + + workload := createDeployment(namespaceName, false, false) + + err = k8sClient.Create(context.Background(), workload) + Expect(err).ToNot(HaveOccurred()) + + so := createScaledObject(soName, namespaceName, workloadName, "apps/v1", "Deployment", false, map[string]string{}, "") + so.Spec.MinReplicaCount = ptr.To[int32](11) + + Eventually(func() error { + return k8sClient.Create(context.Background(), so) + }).Should(HaveOccurred()) +}) + +var _ = It("should validate minreplicacount and maxreplicacount are all equal to zero", func() { + + namespaceName := "empty-triggers-set" + namespace := createNamespace(namespaceName) + + err := k8sClient.Create(context.Background(), namespace) + Expect(err).ToNot(HaveOccurred()) + + workload := createDeployment(namespaceName, false, false) + + err = k8sClient.Create(context.Background(), workload) + Expect(err).ToNot(HaveOccurred()) + + so := createScaledObject(soName, namespaceName, workloadName, "apps/v1", "Deployment", false, map[string]string{}, "") + so.Spec.MinReplicaCount = ptr.To[int32](0) + so.Spec.MinReplicaCount = ptr.To[int32](0) + + Eventually(func() error { + return k8sClient.Create(context.Background(), so) + }).ShouldNot(HaveOccurred()) +}) + +var _ = It("shouldn't validate negative idlereplicacount", func() { + + namespaceName := "empty-triggers-set" + namespace := createNamespace(namespaceName) + + err := k8sClient.Create(context.Background(), namespace) + Expect(err).ToNot(HaveOccurred()) + + workload := createDeployment(namespaceName, false, false) + + err = k8sClient.Create(context.Background(), workload) + Expect(err).ToNot(HaveOccurred()) + + so := createScaledObject(soName, namespaceName, workloadName, "apps/v1", "Deployment", false, map[string]string{}, "") + so.Spec.IdleReplicaCount = ptr.To[int32](-1) + + Eventually(func() error { + return k8sClient.Create(context.Background(), so) + }).Should(HaveOccurred()) +}) + var _ = AfterSuite(func() { cancel() By("tearing down the test environment") From fae86885490f2632694b88442b22860cbb6528be Mon Sep 17 00:00:00 2001 From: Shane Date: Tue, 10 Dec 2024 10:18:18 +0800 Subject: [PATCH 07/10] revise test namespace Signed-off-by: Shane --- apis/keda/v1alpha1/scaledobject_webhook_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apis/keda/v1alpha1/scaledobject_webhook_test.go b/apis/keda/v1alpha1/scaledobject_webhook_test.go index f00bdb90f8e..834abf19433 100644 --- a/apis/keda/v1alpha1/scaledobject_webhook_test.go +++ b/apis/keda/v1alpha1/scaledobject_webhook_test.go @@ -1050,7 +1050,7 @@ var _ = It("should validate the so creation with ScalingModifiers.Formula - doub var _ = It("shouldn't validate negative minreplicacount", func() { - namespaceName := "minreplicas-invalid" + namespaceName := "negative-minreplicas" namespace := createNamespace(namespaceName) err := k8sClient.Create(context.Background(), namespace) @@ -1071,7 +1071,7 @@ var _ = It("shouldn't validate negative minreplicacount", func() { var _ = It("shouldn't validate minreplicacount greater than maxreplicacount", func() { - namespaceName := "empty-triggers-set" + namespaceName := "minreplicas-greater-than-maxreplicas" namespace := createNamespace(namespaceName) err := k8sClient.Create(context.Background(), namespace) @@ -1092,7 +1092,7 @@ var _ = It("shouldn't validate minreplicacount greater than maxreplicacount", fu var _ = It("should validate minreplicacount and maxreplicacount are all equal to zero", func() { - namespaceName := "empty-triggers-set" + namespaceName := "minreplicas-maxreplicas-zero" namespace := createNamespace(namespaceName) err := k8sClient.Create(context.Background(), namespace) @@ -1114,7 +1114,7 @@ var _ = It("should validate minreplicacount and maxreplicacount are all equal to var _ = It("shouldn't validate negative idlereplicacount", func() { - namespaceName := "empty-triggers-set" + namespaceName := "negative-idlereplicas" namespace := createNamespace(namespaceName) err := k8sClient.Create(context.Background(), namespace) From 55d48fab0261d5db88bd74ba3d494a4957260e27 Mon Sep 17 00:00:00 2001 From: Shane Date: Tue, 10 Dec 2024 11:26:37 +0800 Subject: [PATCH 08/10] Update scaledobject_webhook_test.go Signed-off-by: Shane --- apis/keda/v1alpha1/scaledobject_webhook_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apis/keda/v1alpha1/scaledobject_webhook_test.go b/apis/keda/v1alpha1/scaledobject_webhook_test.go index 834abf19433..723aa67bda3 100644 --- a/apis/keda/v1alpha1/scaledobject_webhook_test.go +++ b/apis/keda/v1alpha1/scaledobject_webhook_test.go @@ -1105,7 +1105,7 @@ var _ = It("should validate minreplicacount and maxreplicacount are all equal to so := createScaledObject(soName, namespaceName, workloadName, "apps/v1", "Deployment", false, map[string]string{}, "") so.Spec.MinReplicaCount = ptr.To[int32](0) - so.Spec.MinReplicaCount = ptr.To[int32](0) + so.Spec.MaxReplicaCount = ptr.To[int32](0) Eventually(func() error { return k8sClient.Create(context.Background(), so) From f6f5c515e25872296e3cdb9e5bf074097e0081cc Mon Sep 17 00:00:00 2001 From: Shane Date: Tue, 10 Dec 2024 11:41:31 +0800 Subject: [PATCH 09/10] Update scaledobject_webhook_test.go Signed-off-by: Shane --- apis/keda/v1alpha1/scaledobject_webhook_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/apis/keda/v1alpha1/scaledobject_webhook_test.go b/apis/keda/v1alpha1/scaledobject_webhook_test.go index 723aa67bda3..91ac87f5786 100644 --- a/apis/keda/v1alpha1/scaledobject_webhook_test.go +++ b/apis/keda/v1alpha1/scaledobject_webhook_test.go @@ -1106,6 +1106,7 @@ var _ = It("should validate minreplicacount and maxreplicacount are all equal to so := createScaledObject(soName, namespaceName, workloadName, "apps/v1", "Deployment", false, map[string]string{}, "") so.Spec.MinReplicaCount = ptr.To[int32](0) so.Spec.MaxReplicaCount = ptr.To[int32](0) + so.Spec.IdleReplicaCount = nil Eventually(func() error { return k8sClient.Create(context.Background(), so) From 542b9dfe64804fb6dd9a488bf83c09ecfafa5150 Mon Sep 17 00:00:00 2001 From: Shane Date: Tue, 17 Dec 2024 08:54:17 +0800 Subject: [PATCH 10/10] Update CHANGELOG.md Signed-off-by: Shane --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 79925834d81..84ed4f3155e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,8 +60,8 @@ To learn more about active deprecations, we recommend checking [GitHub Discussio - **General**: Enable OpenSSF Scorecard to enhance security practices across the project ([#5913](https://github.com/kedacore/keda/issues/5913)) - **General**: Introduce new NSQ scaler ([#3281](https://github.com/kedacore/keda/issues/3281)) -- **General**: Optimize all webhook checkReplicas code ([#6344](https://github.com/kedacore/keda/pull/6344)) - **General**: Operator flag to control patching of webhook resources certificates ([#6184](https://github.com/kedacore/keda/issues/6184)) +- **General**: Optimize all webhook checkReplicas code ([#6344](https://github.com/kedacore/keda/pull/6344)) #### Experimental @@ -585,7 +585,7 @@ New deprecation(s): - **General**: Drop a transitive dependency on bou.ke/monkey ([#4364](https://github.com/kedacore/keda/issues/4364)) - **General**: Fix odd number of arguments passed as key-value pairs for logging ([#4368](https://github.com/kedacore/keda/issues/4368)) - **General**: Refactor several functions for Status & Conditions handling into pkg util functions ([#2906](https://github.com/kedacore/keda/pull/2906)) -- **General**: Stop logging errors for paused ScaledObject (with `autoscaling.keda.sh/paused-replicas` annotation) by skipping reconciliation loop for the object (stop the scale loop and delete the HPA) ([#4253](https://github.com/kedacore/keda/pull/4253)) +- **General**: Stop logging errors for paused ScaledObject (with `autoscaling.keda.sh/paused-` annotation) by skipping reconciliation loop for the object (stop the scale loop and delete the HPA) ([#4253](https://github.com/kedacore/keda/pull/4253)) - **General**: Trying to prevent operator crash when accessing `ScaledObject.Status.ScaleTargetGVKR` ([#4389](https://github.com/kedacore/keda/issues/4389)) - **General**: Use default metrics provider from `sigs.k8s.io/custom-metrics-apiserver` ([#4473](https://github.com/kedacore/keda/pull/4473)) @@ -906,7 +906,7 @@ None. ### New -- **General**: Introduce annotation `"autoscaling.keda.sh/paused-replicas"` for ScaledObjects to pause scaling at a fixed replica count. ([#944](https://github.com/kedacore/keda/issues/944)) +- **General**: Introduce annotation `"autoscaling.keda.sh/paused-"` for ScaledObjects to pause scaling at a fixed replica count. ([#944](https://github.com/kedacore/keda/issues/944)) - **General**: Introduce ARM-based container image for KEDA ([#2263](https://github.com/kedacore/keda/issues/2263)|[#2262](https://github.com/kedacore/keda/issues/2262)) - **General**: Introduce new AWS DynamoDB Scaler ([#2482](https://github.com/kedacore/keda/issues/2482)) - **General**: Introduce new Azure Data Explorer Scaler ([#1488](https://github.com/kedacore/keda/issues/1488)|[#2734](https://github.com/kedacore/keda/issues/2734))