diff --git a/ray-operator/.golangci.yml b/ray-operator/.golangci.yml index dde1b1e21a..3bc01827ea 100644 --- a/ray-operator/.golangci.yml +++ b/ray-operator/.golangci.yml @@ -1,6 +1,9 @@ linters-settings: gofmt: simplify: true + gosec: + excludes: + - G601 ginkgolinter: forbid-focus-container: true goimports: @@ -62,7 +65,7 @@ linters: - gofmt - gofumpt - goimports -# - gosec + - gosec - gosimple # - govet - ineffassign diff --git a/ray-operator/apis/ray/v1/webhook_suite_test.go b/ray-operator/apis/ray/v1/webhook_suite_test.go index a0313630a1..52f4e10f40 100644 --- a/ray-operator/apis/ray/v1/webhook_suite_test.go +++ b/ray-operator/apis/ray/v1/webhook_suite_test.go @@ -110,7 +110,11 @@ var _ = BeforeSuite(func() { dialer := &net.Dialer{Timeout: time.Second} addrPort := fmt.Sprintf("%s:%d", webhookInstallOptions.LocalServingHost, webhookInstallOptions.LocalServingPort) Eventually(func() error { - conn, err := tls.DialWithDialer(dialer, "tcp", addrPort, &tls.Config{InsecureSkipVerify: true}) + conn, err := tls.DialWithDialer(dialer, + "tcp", + addrPort, + &tls.Config{InsecureSkipVerify: true}, //nolint:gosec // Allow InsecureSkipVerify because we are connecting to our own webhook server. + ) if err != nil { return err } diff --git a/ray-operator/controllers/ray/utils/util.go b/ray-operator/controllers/ray/utils/util.go index 0c188624e6..684c5b8666 100644 --- a/ray-operator/controllers/ray/utils/util.go +++ b/ray-operator/controllers/ray/utils/util.go @@ -2,7 +2,7 @@ package utils import ( "context" - "crypto/sha1" + "crypto/sha1" //nolint:gosec // We are not using this for security purposes "encoding/base32" "fmt" "math" @@ -470,7 +470,7 @@ func GenerateJsonHash(obj interface{}) (string, error) { return "", err } - hashBytes := sha1.Sum(serialObj) + hashBytes := sha1.Sum(serialObj) //nolint:gosec // We are not using this for security purposes // Convert to an ASCII string hashStr := base32.HexEncoding.EncodeToString(hashBytes[:])