From 2bc94c002392cb900ce6ca47574eafa3f4e55959 Mon Sep 17 00:00:00 2001 From: Salim Afiune Maya Date: Fri, 29 Jan 2021 12:16:07 -0600 Subject: [PATCH] fix(cli): avoid daily update check during install When users install the CLI we should not run the daily update check since it could create files on the home directory of a mortal user. Additionally, we are turning off telemetry so that we don't have multiple events being reported on install. JIRA: ALLY-305 Signed-off-by: Salim Afiune Maya --- cli/cmd/version.go | 4 ++++ cli/install.sh | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cli/cmd/version.go b/cli/cmd/version.go index 678129e5f..5f61d00a5 100644 --- a/cli/cmd/version.go +++ b/cli/cmd/version.go @@ -114,6 +114,10 @@ func versionCacheDir() (string, error) { // dailyVersionCheck will execute a version check on a daily basis, the function uses // the file ~/.config/lacework/version_cache to track the last check time func dailyVersionCheck() error { + if disabled := os.Getenv(lwupdater.DisableEnv); disabled != "" { + return nil + } + cacheDir, err := versionCacheDir() if err != nil { return err diff --git a/cli/install.sh b/cli/install.sh index 78fb14a3c..1302786bf 100755 --- a/cli/install.sh +++ b/cli/install.sh @@ -214,7 +214,7 @@ install_cli() { print_cli_version() { log "Verifying installed Lacework CLI version" - "${installation_dir}/${binary_name}" version + LW_TELEMETRY_DISABLE=1 LW_UPDATES_DISABLE=1 "${installation_dir}/${binary_name}" version } download_file() {