Skip to content

Commit 4ccc489

Browse files
committed
cleanup: add goling gosec exception for Secret type constants
1 parent 03eec53 commit 4ccc489

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

pkg/credentials/common/constants.go

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package common
22

33
// Secret key constants used in credential files,
44
// so as to avoid reliance on corev1.Secret.
5+
//
6+
//nolint:gosec // for known Kubernetes secret-type constants, not real credentials
57
const (
68
BasicAuthUsernameKey = "username"
79
BasicAuthPasswordKey = "password"

pkg/credentials/gitcreds/creds.go

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package gitcreds
1919
import (
2020
"flag"
2121
"fmt"
22+
2223
"github.com/tektoncd/pipeline/pkg/credentials/common"
2324
credmatcher "github.com/tektoncd/pipeline/pkg/credentials/matcher"
2425
credwriter "github.com/tektoncd/pipeline/pkg/credentials/writer"

pkg/credentials/matcher/matcher.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2024 The Tekton Authors
2+
Copyright 2025 The Tekton Authors
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -34,8 +34,7 @@ type Secret interface {
3434
// Matcher is the interface for a credential initializer of any type.
3535
type Matcher interface {
3636
// MatchingAnnotations extracts flags for the credential
37-
// helper from the supplied secret and returns a slice (of
38-
// length 0 or greater) of applicable domains.
37+
// helper from the supplied secret and returns a slice (of length 0 or greater)
3938
MatchingAnnotations(secret Secret) []string
4039
}
4140

@@ -51,7 +50,6 @@ func GetSecretType(secret Secret) string {
5150
if v.Kind() == reflect.Ptr {
5251
v = v.Elem()
5352
}
54-
// Grab the field by name
5553
f := v.FieldByName("Type")
5654
if !f.IsValid() || !f.CanInterface() {
5755
return ""

0 commit comments

Comments
 (0)