Skip to content

Commit

Permalink
chore: address gosec issues
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Gillson <[email protected]>
  • Loading branch information
TylerGillson committed May 27, 2024
1 parent 807402b commit 0ddb240
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions client/addon_deployment_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ func (h *V1Client) PatchWithRetry(params *clientV1.V1SpectroClustersPatchProfile
var err error
rand.NewSource(time.Now().UnixNano())
for attempt := 0; attempt < h.retryAttempts; attempt++ {
// small jitter to prevent simultaneous retries
s := rand.Intn(h.retryAttempts) // n will be between 0 and number of retries
// small jitter to prevent simultaneous retries. n will be between 0 and number of retries.
s := rand.Intn(h.retryAttempts) // #nosec G404 - random number is not used for security purposes
log.Printf("Sleeping %d seconds, retry: %d, cluster:%s, profile:%s, ", s, attempt, params.UID, params.Body.Profiles[0].UID)
time.Sleep(time.Duration(s) * time.Second)
err = h.ClustersPatchProfiles(params)
Expand Down
2 changes: 1 addition & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ func (h *V1Client) httpClient() *http.Client {
Transport: &http.Transport{
Proxy: http.ProxyFromEnvironment,
TLSClientConfig: &tls.Config{
InsecureSkipVerify: h.insecureSkipVerify,
InsecureSkipVerify: h.insecureSkipVerify, // #nosec G402 - InsecureSkipVerify is enabled via user input
},
},
}
Expand Down

0 comments on commit 0ddb240

Please sign in to comment.