Skip to content

Commit

Permalink
[Backport 7.58.x] [clusteragent/autoscaling] Pass correct value of in…
Browse files Browse the repository at this point in the history
…ternal spec to hash (#29391)

Co-authored-by: Jennifer Chen <[email protected]>
  • Loading branch information
agent-platform-auto-pr[bot] and jennchenn authored Sep 17, 2024
1 parent 692dae1 commit 34131a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/clusteragent/autoscaling/workload/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 34131a3

Please sign in to comment.