Skip to content

Commit

Permalink
fix golangci lint
Browse files Browse the repository at this point in the history
Signed-off-by: silenceper <silenceper@gmail.com>
  • Loading branch information
silenceper committed Oct 10, 2020
1 parent 2919607 commit b7447cf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions pkg/scalers/cpu_memory_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ type cpuMemoryMetadata struct {
}

// NewCPUMemoryScaler creates a new cpuMemoryScaler
func NewCPUMemoryScaler(resourceName v1.ResourceName, resolvedEnv, metadata map[string]string) (Scaler, error) {
meta, parseErr := parseResourceMetadata(metadata, resolvedEnv)
func NewCPUMemoryScaler(resourceName v1.ResourceName, metadata map[string]string) (Scaler, error) {
meta, parseErr := parseResourceMetadata(metadata)
if parseErr != nil {
return nil, fmt.Errorf("error parsing cron metadata: %s", parseErr)
}
Expand All @@ -37,7 +37,7 @@ func NewCPUMemoryScaler(resourceName v1.ResourceName, resolvedEnv, metadata map[
}, nil
}

func parseResourceMetadata(metadata, resolvedEnv map[string]string) (*cpuMemoryMetadata, error) {
func parseResourceMetadata(metadata map[string]string) (*cpuMemoryMetadata, error) {
meta := &cpuMemoryMetadata{}
if val, ok := metadata["type"]; ok && val != "" {
meta.Type = v2beta2.MetricTargetType(val)
Expand Down
4 changes: 2 additions & 2 deletions pkg/scaling/scale_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ func buildScaler(name, namespace, triggerType string, resolvedEnv, triggerMetada
case "azure-servicebus":
return scalers.NewAzureServiceBusScaler(resolvedEnv, triggerMetadata, authParams, podIdentity)
case "cpu":
return scalers.NewCPUMemoryScaler(corev1.ResourceCPU, resolvedEnv, triggerMetadata)
return scalers.NewCPUMemoryScaler(corev1.ResourceCPU, triggerMetadata)
case "cron":
return scalers.NewCronScaler(resolvedEnv, triggerMetadata)
case "external":
Expand All @@ -421,7 +421,7 @@ func buildScaler(name, namespace, triggerType string, resolvedEnv, triggerMetada
case "liiklus":
return scalers.NewLiiklusScaler(resolvedEnv, triggerMetadata)
case "memory":
return scalers.NewCPUMemoryScaler(corev1.ResourceMemory, resolvedEnv, triggerMetadata)
return scalers.NewCPUMemoryScaler(corev1.ResourceMemory, triggerMetadata)
case "metrics-api":
return scalers.NewMetricsAPIScaler(resolvedEnv, triggerMetadata, authParams)
case "mysql":
Expand Down

0 comments on commit b7447cf

Please sign in to comment.