From cc71d01157a34bb0732574454a9a686f1af2af49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wilson=20J=C3=BAnior?= Date: Mon, 6 May 2024 17:12:26 -0300 Subject: [PATCH] fix lint --- pkg/build/buildkit/scaler/downscaler_test.go | 4 ++++ pkg/build/buildkit/scaler/upscaler.go | 7 ++++++- pkg/build/buildkit/scaler/upscaler_test.go | 4 +++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/pkg/build/buildkit/scaler/downscaler_test.go b/pkg/build/buildkit/scaler/downscaler_test.go index 63d048f..5db8d29 100644 --- a/pkg/build/buildkit/scaler/downscaler_test.go +++ b/pkg/build/buildkit/scaler/downscaler_test.go @@ -1,3 +1,7 @@ +// Copyright 2024 tsuru authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + package scaler import ( diff --git a/pkg/build/buildkit/scaler/upscaler.go b/pkg/build/buildkit/scaler/upscaler.go index c886ac7..8c540d2 100644 --- a/pkg/build/buildkit/scaler/upscaler.go +++ b/pkg/build/buildkit/scaler/upscaler.go @@ -1,3 +1,7 @@ +// Copyright 2024 tsuru authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + package scaler import ( @@ -25,7 +29,8 @@ func MayUpscale(ctx context.Context, cs kubernetes.Interface, ns, statefulset st wantedReplicas := int32(1) if lastReplicas := stfullset.Annotations[metadata.DeployAgentLastReplicasAnnotationKey]; lastReplicas != "" { - replicas, err := strconv.ParseInt(lastReplicas, 10, 32) + var replicas int64 + replicas, err = strconv.ParseInt(lastReplicas, 10, 32) if err != nil { return err } diff --git a/pkg/build/buildkit/scaler/upscaler_test.go b/pkg/build/buildkit/scaler/upscaler_test.go index 160726f..e3de231 100644 --- a/pkg/build/buildkit/scaler/upscaler_test.go +++ b/pkg/build/buildkit/scaler/upscaler_test.go @@ -1,3 +1,6 @@ +// Copyright 2024 tsuru authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. package scaler import ( @@ -59,7 +62,6 @@ func TestMayScaleStatefulsetScale(t *testing.T) { require.Len(t, rs.Items, 1) assert.Equal(t, int32(1), *rs.Items[0].Spec.Replicas) - } func TestMayScaleStatefulsetScaleFromPreviousReplicas(t *testing.T) {