Skip to content

Commit

Permalink
fix(cli): avoid daily update check during install
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
afiune committed Jan 29, 2021
1 parent a5c5eeb commit 2bc94c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions cli/cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cli/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 2bc94c0

Please sign in to comment.