Skip to content

Commit

Permalink
fix: Check if HPA has the same scaleTargetRef
Browse files Browse the repository at this point in the history
Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
  • Loading branch information
terrytangyuan committed Dec 10, 2023
1 parent 611c4a0 commit e612fba
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ func (r *HPAReconciler) checkHPAExist(client client.Client) (constants.CheckResu
}

func semanticHPAEquals(desired, existing *autoscalingv2.HorizontalPodAutoscaler) bool {
return equality.Semantic.DeepEqual(desired.Spec.Metrics, existing.Spec.Metrics) &&
return equality.Semantic.DeepEqual(desired.Spec.ScaleTargetRef, existing.Spec.ScaleTargetRef) &&
equality.Semantic.DeepEqual(desired.Spec.Metrics, existing.Spec.Metrics) &&
equality.Semantic.DeepEqual(desired.Spec.MaxReplicas, existing.Spec.MaxReplicas) &&
equality.Semantic.DeepEqual(*desired.Spec.MinReplicas, *existing.Spec.MinReplicas)
}
Expand Down

0 comments on commit e612fba

Please sign in to comment.