diff --git a/pkg/hpa/service.go b/pkg/hpa/service.go index 9bfd1237..eabcff65 100644 --- a/pkg/hpa/service.go +++ b/pkg/hpa/service.go @@ -423,6 +423,11 @@ func (c *Service) ChangeHPAFromTortoiseRecommendation(tortoise *autoscalingv1bet } func (c *Service) UpdateHPASpecFromTortoiseAutoscalingPolicy(ctx context.Context, tortoise *autoscalingv1beta2.Tortoise, dm *v1.Deployment, now time.Time) (*autoscalingv1beta2.Tortoise, error) { + if tortoise.Spec.UpdateMode == autoscalingv1beta2.UpdateModeOff { + // When UpdateMode is Off, we don't update HPA. + return tortoise, nil + } + if !HasHorizontal(tortoise) { err := c.DeleteHPACreatedByTortoise(ctx, tortoise) if err != nil && !apierrors.IsNotFound(err) {