Disable telemetry by env var MIZU_DISABLE_TELEMTRY (#517)

This commit is contained in:
Igor Gov 2021-12-02 09:20:27 +02:00 committed by GitHub
parent c47959dbd8
commit 2910611111
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,7 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"net/http" "net/http"
"os"
"github.com/denisbrodbeck/machineid" "github.com/denisbrodbeck/machineid"
"github.com/up9inc/mizu/cli/apiserver" "github.com/up9inc/mizu/cli/apiserver"
@ -62,6 +63,9 @@ func ReportAPICalls(apiProvider *apiserver.Provider) {
} }
func shouldRunTelemetry() bool { func shouldRunTelemetry() bool {
if _, present := os.LookupEnv("MIZU_DISABLE_TELEMTRY"); present {
return false
}
if !config.Config.Telemetry { if !config.Config.Telemetry {
return false return false
} }