Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
wpjunior committed May 6, 2024
1 parent 204d81f commit cc71d01
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
4 changes: 4 additions & 0 deletions pkg/build/buildkit/scaler/downscaler_test.go
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down
7 changes: 6 additions & 1 deletion pkg/build/buildkit/scaler/upscaler.go
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down Expand Up @@ -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
}
Expand Down
4 changes: 3 additions & 1 deletion pkg/build/buildkit/scaler/upscaler_test.go
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit cc71d01

Please sign in to comment.