From 2fac7dd9473acab1a06000a22eeabf5223f4e32e Mon Sep 17 00:00:00 2001 From: Jennifer Chen <32009013+jennchenn@users.noreply.github.com> Date: Mon, 16 Sep 2024 18:53:27 -0400 Subject: [PATCH] [clusteragent/autoscaling] Pass correct value of internal spec to hash (#29374) --- pkg/clusteragent/autoscaling/workload/controller.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/clusteragent/autoscaling/workload/controller.go b/pkg/clusteragent/autoscaling/workload/controller.go index 27ae6f77070aa9..ce46091da3ba67 100644 --- a/pkg/clusteragent/autoscaling/workload/controller.go +++ b/pkg/clusteragent/autoscaling/workload/controller.go @@ -241,13 +241,13 @@ func (c *Controller) syncPodAutoscaler(ctx context.Context, key, ns, name string // and compare it with the one in the PodAutoscaler. If they differ, we should update the PodAutoscaler // otherwise store the Generation if podAutoscalerInternal.Generation() != podAutoscaler.Generation { - localHash, err := autoscaling.ObjectHash(podAutoscalerInternal.Spec) + localHash, err := autoscaling.ObjectHash(podAutoscalerInternal.Spec()) if err != nil { c.store.Unlock(key) return autoscaling.Requeue, fmt.Errorf("Failed to compute Spec hash for PodAutoscaler: %s/%s, err: %v", ns, name, err) } - remoteHash, err := autoscaling.ObjectHash(podAutoscaler.Spec) + remoteHash, err := autoscaling.ObjectHash(&podAutoscaler.Spec) if err != nil { c.store.Unlock(key) return autoscaling.Requeue, fmt.Errorf("Failed to compute Spec hash for PodAutoscaler: %s/%s, err: %v", ns, name, err)