lint: enable gosec

Signed-off-by: Justin Chadwell <me@jedevc.com>
This commit is contained in:
Justin Chadwell 2023-02-01 10:11:56 +00:00
parent 48357ee0c6
commit 5da09f0c23
2 changed files with 8 additions and 1 deletions

View File

@ -22,6 +22,7 @@ linters:
- staticcheck
- typecheck
- nolintlint
- gosec
disable-all: true
linters-settings:
@ -32,6 +33,12 @@ linters-settings:
# The io/ioutil package has been deprecated.
# https://go.dev/doc/go1.16#ioutil
- io/ioutil
gosec:
excludes:
- G204 # Audit use of command execution
- G402 # TLS MinVersion too low
config:
G306: "0644"
issues:
exclude-rules:

View File

@ -37,7 +37,7 @@ func (pc *RandomPodChooser) ChoosePod(ctx context.Context) (*corev1.Pod, error)
if randSource == nil {
randSource = rand.NewSource(time.Now().Unix())
}
rnd := rand.New(randSource)
rnd := rand.New(randSource) //nolint:gosec // no strong seeding required
n := rnd.Int() % len(pods)
logrus.Debugf("RandomPodChooser.ChoosePod(): len(pods)=%d, n=%d", len(pods), n)
return pods[n], nil