Skip to content

Commit

Permalink
fix: Fix lint issues
Browse files Browse the repository at this point in the history
Signed-off-by: Indresh-Prakash <indreshprakash24@gmail.com>
  • Loading branch information
Indresh2410 committed Jun 24, 2023
1 parent 189efc6 commit 50cc12d
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions pkg/scaling/resolver/scale_resolvers.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"bytes"
"context"
"fmt"
"strconv"
"strings"

"github.com/go-logr/logr"
Expand All @@ -41,6 +42,8 @@ const (
referenceOperator = '$'
referenceOpener = '('
referenceCloser = ')'
boolTrue = true
boolFalse = false
)

var (
Expand All @@ -52,13 +55,13 @@ var (
// isSecretAccessRestricted returns whether secret access need to be restricted in KEDA namespace
func isSecretAccessRestricted(logger logr.Logger) bool {
if restrictSecretAccess == "" {
return false
return boolFalse
}
if strings.ToLower(restrictSecretAccess) == "true" {
if strings.ToLower(restrictSecretAccess) == strconv.FormatBool(boolTrue) {
logger.V(1).Info("Secret Access is restricted to be in Cluster Object Namespace, please use ClusterTriggerAuthentication instead of TriggerAuthentication", "Cluster Object Namespace", kedaNamespace, "Env Var", util.RestrictSecretAccessEnvVar, "Env Value", strings.ToLower(restrictSecretAccess))
return true
return boolTrue
}
return false
return boolFalse
}

// ResolveScaleTargetPodSpec for given scalableObject inspects the scale target workload,
Expand Down Expand Up @@ -151,11 +154,11 @@ func ResolveContainerEnv(ctx context.Context, client client.Client, logger logr.

var container corev1.Container
if containerName != "" {
containerWithNameFound := false
containerWithNameFound := boolFalse
for _, c := range podSpec.Containers {
if c.Name == containerName {
container = c
containerWithNameFound = true
containerWithNameFound = boolTrue
break
}
}
Expand Down Expand Up @@ -387,9 +390,9 @@ func resolveEnv(ctx context.Context, client client.Client, logger logr.Logger, c

func readSecrets(secretAccessRestricted bool, namespace string) bool {
if secretAccessRestricted && (namespace != kedaNamespace) {
return false
return boolFalse
}
return true
return boolTrue
}

func resolveEnvValue(value string, env map[string]string) string {
Expand Down

0 comments on commit 50cc12d

Please sign in to comment.