diff --git a/.golangci.yaml b/.golangci.yaml index fcd690bd3f..d770e04905 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -33,7 +33,7 @@ linters: #- thelper #- tparallel - typecheck - #- unconvert + - unconvert - unparam - unused - varcheck diff --git a/core/logger/logger.go b/core/logger/logger.go index f5f76e80a2..1875a4639f 100644 --- a/core/logger/logger.go +++ b/core/logger/logger.go @@ -78,7 +78,7 @@ type LogOption func(*zap.Config) // WithLogLevel will set the log level on the Logger Config func WithLogLevel(l zapcore.Level) LogOption { return func(c *zap.Config) { - c.Level = zap.NewAtomicLevelAt(zapcore.Level(l)) + c.Level = zap.NewAtomicLevelAt(l) } } diff --git a/pkg/services/auth/auth.go b/pkg/services/auth/auth.go index 2d1f166f2a..992718750a 100644 --- a/pkg/services/auth/auth.go +++ b/pkg/services/auth/auth.go @@ -222,12 +222,12 @@ func extractSecretPart(secret *corev1.Secret, key string) []byte { var ok bool - data, ok = secret.Data[string(key)] + data, ok = secret.Data[key] if !ok { // StringData is a write-only field, flux generates secrets on disk with StringData // Once they get applied on the cluster, Kubernetes populates Data and removes StringData. // Handle this case here to be able to extract data no matter the "state" of the object. - data = []byte(secret.StringData[string(key)]) + data = []byte(secret.StringData[key]) } return data diff --git a/pkg/testutils/testutils.go b/pkg/testutils/testutils.go index 75354a2a34..6b45d6e5c2 100644 --- a/pkg/testutils/testutils.go +++ b/pkg/testutils/testutils.go @@ -195,7 +195,7 @@ func MakeJWToken(t *testing.T, key *rsa.PrivateKey, email string, opts ...func(m Audience: jwt.Audience{"test-service"}, NotBefore: jwt.NewNumericDate(notBefore), IssuedAt: jwt.NewNumericDate(notBefore), - Expiry: jwt.NewNumericDate(notBefore.Add(time.Duration(maxAgeSecondsAuthCookie))), + Expiry: jwt.NewNumericDate(notBefore.Add(maxAgeSecondsAuthCookie)), } extraClaims := map[string]any{ "groups": []string{"testing"},