Skip to content

Commit

Permalink
goimports format
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmelsayed committed Oct 12, 2021
1 parent b7d1d0d commit cb0f1bc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions adapter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ import (
"context"
"flag"
"fmt"
kedacontrollers "github.com/kedacore/keda/v2/controllers/keda"
"os"
"runtime"
"sigs.k8s.io/controller-runtime/pkg/controller"
"strconv"
"time"

kedacontrollers "github.com/kedacore/keda/v2/controllers/keda"
"sigs.k8s.io/controller-runtime/pkg/controller"

appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
k8sruntime "k8s.io/apimachinery/pkg/runtime"
Expand Down
1 change: 1 addition & 0 deletions controllers/keda/metrics_adapter_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package keda

import (
"context"

kedav1alpha1 "github.com/kedacore/keda/v2/apis/keda/v1alpha1"
"github.com/kedacore/keda/v2/pkg/scaling"
ctrl "sigs.k8s.io/controller-runtime"
Expand Down
6 changes: 3 additions & 3 deletions pkg/scaling/scale_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func (h *scaleHandler) GetScalersCache(scalableObject interface{}) (*cache.Scale
return nil, err
}

scalers, factories, err := h.buildScalers(withTriggers, podTemplateSpec, containerName)
scalers, factories := h.buildScalers(withTriggers, podTemplateSpec, containerName)
if err != nil {
h.logger.Error(err, "error building some scalers")
}
Expand Down Expand Up @@ -273,7 +273,7 @@ func (h *scaleHandler) checkScalers(ctx context.Context, scalableObject interfac
}

// buildScalers returns list of Scalers for the specified triggers
func (h *scaleHandler) buildScalers(withTriggers *kedav1alpha1.WithTriggers, podTemplateSpec *corev1.PodTemplateSpec, containerName string) ([]scalers.Scaler, []func() (scalers.Scaler, error), error) {
func (h *scaleHandler) buildScalers(withTriggers *kedav1alpha1.WithTriggers, podTemplateSpec *corev1.PodTemplateSpec, containerName string) ([]scalers.Scaler, []func() (scalers.Scaler, error)) {
logger := h.logger.WithValues("type", withTriggers.Kind, "namespace", withTriggers.Namespace, "name", withTriggers.Name)
var err error
resolvedEnv := make(map[string]string)
Expand Down Expand Up @@ -319,7 +319,7 @@ func (h *scaleHandler) buildScalers(withTriggers *kedav1alpha1.WithTriggers, pod
factories = append(factories, factory)
}

return scalersRes, factories, nil
return scalersRes, factories
}

func buildScaler(client client.Client, triggerType string, config *scalers.ScalerConfig) (scalers.Scaler, error) {
Expand Down
3 changes: 2 additions & 1 deletion pkg/scaling/scale_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ package scaling
import (
"context"
"errors"
"testing"

"github.com/golang/mock/gomock"
kedav1alpha1 "github.com/kedacore/keda/v2/apis/keda/v1alpha1"
mock_scalers "github.com/kedacore/keda/v2/pkg/mock/mock_scaler"
Expand All @@ -30,7 +32,6 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/tools/record"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"testing"
)

func TestCheckScaledObjectScalersWithError(t *testing.T) {
Expand Down

0 comments on commit cb0f1bc

Please sign in to comment.