Skip to content

Commit

Permalink
Merge pull request #1995 from chirino/fix-lint
Browse files Browse the repository at this point in the history
fix: build is broken after go 1.22 upgrade, it needs new golangci-lint installed.
  • Loading branch information
chirino authored Mar 19, 2024
2 parents c45fc91 + f980cd9 commit ad5b88e
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 12 deletions.
4 changes: 2 additions & 2 deletions cmd/apiserver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,9 @@ func main() {
User: command.String("smtp-user"),
Password: command.String("smtp-password"),
}
if command.Bool("smtp-tls") { // #nosec G402
if command.Bool("smtp-tls") {
smtpServer.Tls = &tls.Config{
InsecureSkipVerify: command.Bool("insecure-tls"),
InsecureSkipVerify: command.Bool("insecure-tls"), // #nosec G402
}
}
api.SmtpServer = smtpServer
Expand Down
4 changes: 2 additions & 2 deletions cmd/nexctl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ func createClientOptions(command *cli.Command) []client.Option {
),
client.WithUserAgent(fmt.Sprintf("nexctl/%s (%s; %s)", Version, runtime.GOOS, runtime.GOARCH)),
}
if command.Bool("insecure-skip-tls-verify") { // #nosec G402
if command.Bool("insecure-skip-tls-verify") {
options = append(options, client.WithTLSConfig(&tls.Config{
InsecureSkipVerify: true,
InsecureSkipVerify: true, // #nosec G402
}))
}
return options
Expand Down
4 changes: 2 additions & 2 deletions hack/install-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ if [ -z "$(which kind)" ] || [ "$1" = "--force" ]; then
fi
if [ -z "$(which golangci-lint)" ] || [ "$1" = "--force" ]; then
echo installing golangci-lint
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.2
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.56.2
fi
if [ -z "$(which swag)" ] || [ "$1" = "--force" ]; then
echo installing swag
Expand All @@ -59,7 +59,7 @@ if [ -z "$(which go-licenses)" ] || [ "$1" = "--force" ]; then
fi
if [ -z "$(which gotestsum)" ] || [ "$1" = "--force" ]; then
echo installing gotestsum
go install gotest.tools/gotestsum@v1.10.0
go install gotest.tools/gotestsum@v1.11.0
fi


4 changes: 2 additions & 2 deletions internal/nexodus/nexodus.go
Original file line number Diff line number Diff line change
Expand Up @@ -553,9 +553,9 @@ func (nx *Nexodus) Start(ctx context.Context, wg *sync.WaitGroup) error {
options = append(options, client.WithPasswordGrant(nx.username, nx.password))
}
}
if nx.insecureSkipTlsVerify { // #nosec G402
if nx.insecureSkipTlsVerify {
options = append(options, client.WithTLSConfig(&tls.Config{
InsecureSkipVerify: true,
InsecureSkipVerify: true, // #nosec G402
}))
}
nx.clientOptions = options
Expand Down
3 changes: 1 addition & 2 deletions pkg/oidcagent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@ func NewOidcAgent(ctx context.Context,
cookieKey string,
) (*OidcAgent, error) {
if insecureTLS {
// #nosec: G402
transport := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, // #nosec: G402
}
client := &http.Client{Transport: transport}
ctx = oidc.ClientContext(ctx, client)
Expand Down
3 changes: 1 addition & 2 deletions pkg/oidcagent/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ func randString(nByte int) (string, error) {
func (o *OidcAgent) prepareContext(c *gin.Context) context.Context {
if o.insecureTLS {
parent := c.Request.Context()
// #nosec: G402
transport := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, // #nosec: G402
}
client := &http.Client{Transport: transport}
return oidc.ClientContext(parent, client)
Expand Down

0 comments on commit ad5b88e

Please sign in to comment.