Skip to content

Commit

Permalink
fix: create empty tls.Config when loading extraCA fails
Browse files Browse the repository at this point in the history
Signed-off-by: Clément Nussbaumer <[email protected]>
  • Loading branch information
clementnuss committed Jan 12, 2024
1 parent fec132d commit 4113065
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/servicecheck/servicecheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package servicecheck

import (
"context"
"crypto/tls"
"fmt"
"log"
"net"
Expand Down Expand Up @@ -51,6 +52,7 @@ func New(_ context.Context, discovery *kubediscovery.Client, promRegistry *prome
tlsConfig, err := generateTLSConfig(os.Getenv("KUBENURSE_EXTRA_CA"))
if err != nil {
log.Printf("cannot generate tlsConfig with KUBENURSE_EXTRA_CA: %s", err)
tlsConfig = &tls.Config{}

Check failure on line 55 in internal/servicecheck/servicecheck.go

View workflow job for this annotation

GitHub Actions / lint-go

G402: TLS MinVersion too low. (gosec)

Check failure on line 55 in internal/servicecheck/servicecheck.go

View workflow job for this annotation

GitHub Actions / lint-go

G402: TLS MinVersion too low. (gosec)
}

tlsConfig.InsecureSkipVerify = os.Getenv("KUBENURSE_INSECURE") == "true"
Expand Down

0 comments on commit 4113065

Please sign in to comment.