Add KUBESHARK_DISABLE_VERSION_CHECK environment variable to opt out of version checking

This commit is contained in:
M. Mert Yildiran 2022-12-30 02:08:44 +03:00
parent 6f6c64c87c
commit cb0c452dd2
No known key found for this signature in database
GPG Key ID: DA5D6DCBB758A461

View File

@ -5,6 +5,7 @@ import (
"fmt" "fmt"
"io" "io"
"net/http" "net/http"
"os"
"runtime" "runtime"
"strings" "strings"
"time" "time"
@ -18,6 +19,10 @@ import (
) )
func CheckNewerVersion() { func CheckNewerVersion() {
if os.Getenv("KUBESHARK_DISABLE_VERSION_CHECK") != "" {
return
}
log.Info().Msg("Checking for a newer version...") log.Info().Msg("Checking for a newer version...")
start := time.Now() start := time.Now()
client := github.NewClient(nil) client := github.NewClient(nil)