From e77b72c10271c405d34d1f810961546a8352864a Mon Sep 17 00:00:00 2001 From: Knative Prow Robot Date: Thu, 4 Jul 2024 20:06:22 +0100 Subject: [PATCH] fix: only add triggerAuth to scaled objects when there is an actual value to reference (#3943) Signed-off-by: Calum Murray Co-authored-by: Calum Murray --- control-plane/pkg/autoscaler/keda/keda.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/control-plane/pkg/autoscaler/keda/keda.go b/control-plane/pkg/autoscaler/keda/keda.go index 9aadbc9101..e4fc1537a1 100644 --- a/control-plane/pkg/autoscaler/keda/keda.go +++ b/control-plane/pkg/autoscaler/keda/keda.go @@ -77,13 +77,14 @@ func GenerateScaleTriggers(cg *kafkainternals.ConsumerGroup, triggerAuthenticati } trigger := kedav1alpha1.ScaleTriggers{ - Type: "kafka", - Metadata: triggerMetadata, - AuthenticationRef: &kedav1alpha1.ScaledObjectAuthRef{}, + Type: "kafka", + Metadata: triggerMetadata, } if triggerAuthentication != nil { - trigger.AuthenticationRef.Name = triggerAuthentication.Name + trigger.AuthenticationRef = &kedav1alpha1.ScaledObjectAuthRef{ + Name: triggerAuthentication.Name, + } } triggers = append(triggers, trigger)