From 08f720f83d32cdf585e595f864ac61faded0a065 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wilson=20J=C3=BAnior?= Date: Thu, 29 Aug 2024 10:36:56 -0300 Subject: [PATCH] avoid to set past-replicas annotation to zero --- pkg/build/buildkit/scaler/downscaler.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/build/buildkit/scaler/downscaler.go b/pkg/build/buildkit/scaler/downscaler.go index 59821db..4e75357 100644 --- a/pkg/build/buildkit/scaler/downscaler.go +++ b/pkg/build/buildkit/scaler/downscaler.go @@ -103,6 +103,9 @@ func RunDownscaler(ctx context.Context, clientset kubernetes.Interface, podSelec } if statefulset.Spec.Replicas != nil { + if *statefulset.Spec.Replicas == 0 { + continue + } statefulset.Annotations[metadata.DeployAgentLastReplicasAnnotationKey] = fmt.Sprintf("%d", *statefulset.Spec.Replicas) }