Repository: code-ready/crc
Pull request #1818 (2021-01-05 19:46:12)

Ask the user to turn on telemetry when running crc setup
``` 
$ crc setup 
CodeReady Containers is constantly improving and we would like to know more about usage!
Would you like to contribute anonymous usage statistics (more details at https://developers.redhat.com/article/tool-data-collection)? [y/N]: y
Thanks for helping us! You can disable telemetry with the command 'crc config set consent-telemetry no'.
...

$ crc setup 
CodeReady Containers is constantly improving and we would like to know more about usage!
Would you like to contribute anonymous usage statistics (more details at https://developers.redhat.com/article/tool-data-collection)? [y/N]: 
No worry, you can still enable telemetry manually with the command 'crc config set consent-telemetry yes'.
...
```

openshift-ci-robot: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/code-ready/crc/pull/1818#" title="Author self-approved">guillaumerose</a>*

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=code-ready%2Fcrc).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

<details >
Needs approval from an approver in each of these files:

- ~~[OWNERS](https://github.com/code-ready/crc/blob/master/OWNERS)~~ [guillaumerose]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->
jsliacan: What's the idea of `-f` with `setup`? To avoid getting the prompt? 
guillaumerose: Yes, avoid the prompt when crc is used in a script on in a CI. There is a condition to detect if the session is interactive or not, but the user can still force it.
gorkem: +1 to adding the instructions for turning off. 
We also need to refer to the privacy statement[1]
FYI @sspeiche 

[1] https://developers.redhat.com/article/tool-data-collection
gbraad: > There is a condition to detect if the session is interactive or not, but the user can still force it.

This has a side-effect of 'forcing' false or true ... or ignoring the no-value state. understandable for the non-interactive flow. but this sounds almost like the `skip-all` for the preflights as this has other side-effects when used.
openshift-ci[bot]: @guillaumerose: The following test **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
ci/prow/images | 2369ddd35baba5269efc5851c016e029a7ae7385 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/1818/pull-ci-code-ready-crc-master-images/1346731803766951936) | `/test images`

[Full PR test history](https://prow.ci.openshift.org/pr-history?org=code-ready&repo=crc&pr=1818). [Your PR dashboard](https://prow.ci.openshift.org/pr?query=is:pr+state:open+author:guillaumerose).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
openshift-ci[bot]: @guillaumerose: The following tests **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
ci/prow/images | 2369ddd35baba5269efc5851c016e029a7ae7385 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/1818/pull-ci-code-ready-crc-master-images/1346731803766951936) | `/test images`
ci/prow/e2e-crc | 2369ddd35baba5269efc5851c016e029a7ae7385 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/1818/pull-ci-code-ready-crc-master-e2e-crc/1346731803733397504) | `/test e2e-crc`

[Full PR test history](https://prow.ci.openshift.org/pr-history?org=code-ready&repo=crc&pr=1818). [Your PR dashboard](https://prow.ci.openshift.org/pr?query=is:pr+state:open+author:guillaumerose).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->

Patch:
diff --git a/cmd/crc-embedder/cmd/extract.go b/cmd/crc-embedder/cmd/extract.go
index e99ce853f..f0cab79ed 100644
--- a/cmd/crc-embedder/cmd/extract.go
+++ b/cmd/crc-embedder/cmd/extract.go
@@ -1,10 +1,10 @@
 package cmd
 
 import (
+	"fmt"
+
 	"github.com/code-ready/crc/pkg/crc/logging"
-	"github.com/code-ready/crc/pkg/crc/output"
 	"github.com/code-ready/crc/pkg/embed"
-
 	"github.com/spf13/cobra"
 )
 
@@ -32,5 +32,5 @@ func runExtract(args []string) {
 	if err != nil {
 		logging.Fatalf("Could not extract data embedded in %s: %v", executablePath, err)
 	}
-	output.Outf("Successfully copied embedded '%s' from %s to %s: %v", embedName, executablePath, destFile, err)
+	fmt.Printf("Successfully copied embedded '%s' from %s to %s: %v", embedName, executablePath, destFile, err)
 }
diff --git a/cmd/crc-embedder/cmd/list.go b/cmd/crc-embedder/cmd/list.go
index 3fe8d6d1a..9ab0c52bb 100644
--- a/cmd/crc-embedder/cmd/list.go
+++ b/cmd/crc-embedder/cmd/list.go
@@ -1,10 +1,10 @@
 package cmd
 
 import (
-	"github.com/code-ready/crc/pkg/crc/logging"
-	"github.com/code-ready/crc/pkg/crc/output"
+	"fmt"
 
 	"github.com/YourFin/binappend"
+	"github.com/code-ready/crc/pkg/crc/logging"
 	"github.com/spf13/cobra"
 )
 
@@ -30,8 +30,8 @@ func runList(args []string) {
 	if err != nil {
 		logging.Fatalf("Could not access data embedded in %s: %v", executablePath, err)
 	}
-	output.Outf("Data files embedded in %s:\n", executablePath)
+	fmt.Printf("Data files embedded in %s:\n", executablePath)
 	for _, name := range extractor.AvalibleData() {
-		output.Outln("\t", name)
+		fmt.Println("\t", name)
 	}
 }
diff --git a/cmd/crc-embedder/cmd/root.go b/cmd/crc-embedder/cmd/root.go
index a062cd816..eb00a0634 100644
--- a/cmd/crc-embedder/cmd/root.go
+++ b/cmd/crc-embedder/cmd/root.go
@@ -1,10 +1,10 @@
 package cmd
 
 import (
+	"fmt"
+
 	"github.com/code-ready/crc/pkg/crc/constants"
 	"github.com/code-ready/crc/pkg/crc/logging"
-	"github.com/code-ready/crc/pkg/crc/output"
-
 	"github.com/spf13/cobra"
 )
 
@@ -41,8 +41,8 @@ func runPrerun() {
 }
 
 func runRoot() {
-	output.Outln("No command given")
-	output.Outln("")
+	fmt.Println("No command given")
+	fmt.Println("")
 }
 
 func runPostrun() {
diff --git a/cmd/crc/cmd/config/config.go b/cmd/crc/cmd/config/config.go
index 4aa2e4cdb..d3ba19a85 100644
--- a/cmd/crc/cmd/config/config.go
+++ b/cmd/crc/cmd/config/config.go
@@ -48,7 +48,7 @@ func RegisterSettings(cfg *config.Config) {
 	cfg.AddSetting(EnableClusterMonitoring, false, config.ValidateBool, config.SuccessfullyApplied)
 
 	// Telemeter Configuration
-	cfg.AddSetting(ConsentTelemetry, false, config.ValidateBool, config.SuccessfullyApplied)
+	cfg.AddSetting(ConsentTelemetry, "", config.ValidateYesNo, config.SuccessfullyApplied)
 }
 
 func isPreflightKey(key string) bool {
diff --git a/cmd/crc/cmd/config/get.go b/cmd/crc/cmd/config/get.go
index 2a6cb92f7..9f694eb79 100644
--- a/cmd/crc/cmd/config/get.go
+++ b/cmd/crc/cmd/config/get.go
@@ -5,7 +5,6 @@ import (
 	"fmt"
 
 	"github.com/code-ready/crc/pkg/crc/config"
-	"github.com/code-ready/crc/pkg/crc/output"
 	"github.com/spf13/cobra"
 )
 
@@ -26,7 +25,7 @@ func configGetCmd(config config.Storage) *cobra.Command {
 			case v.IsDefault:
 				return fmt.Errorf("Configuration property '%s' is not set. Default value is '%s'", key, v.AsString())
 			default:
-				output.Outln(key, ":", v.AsString())
+				fmt.Println(key, ":", v.AsString())
 			}
 			return nil
 		},
diff --git a/cmd/crc/cmd/config/set.go b/cmd/crc/cmd/config/set.go
index f6b356b20..0afc89d54 100644
--- a/cmd/crc/cmd/config/set.go
+++ b/cmd/crc/cmd/config/set.go
@@ -2,9 +2,9 @@ package config
 
 import (
 	"errors"
+	"fmt"
 
 	"github.com/code-ready/crc/pkg/crc/config"
-	"github.com/code-ready/crc/pkg/crc/output"
 	"github.com/spf13/cobra"
 )
 
@@ -23,7 +23,7 @@ func configSetCmd(config config.Storage) *cobra.Command {
 			}
 
 			if setMessage != "" {
-				output.Outln(setMessage)
+				fmt.Println(setMessage)
 			}
 			return nil
 		},
diff --git a/cmd/crc/cmd/config/unset.go b/cmd/crc/cmd/config/unset.go
index cfbe6484b..222c20595 100644
--- a/cmd/crc/cmd/config/unset.go
+++ b/cmd/crc/cmd/config/unset.go
@@ -2,9 +2,9 @@ package config
 
 import (
 	"errors"
+	"fmt"
 
 	"github.com/code-ready/crc/pkg/crc/config"
-	"github.com/code-ready/crc/pkg/crc/output"
 	"github.com/spf13/cobra"
 )
 
@@ -22,7 +22,7 @@ func configUnsetCmd(config config.Storage) *cobra.Command {
 				return err
 			}
 			if unsetMessage != "" {
-				output.Outln(unsetMessage)
+				fmt.Println(unsetMessage)
 			}
 			return nil
 		},
diff --git a/cmd/crc/cmd/ip.go b/cmd/crc/cmd/ip.go
index 576178ac0..477040f60 100644
--- a/cmd/crc/cmd/ip.go
+++ b/cmd/crc/cmd/ip.go
@@ -1,7 +1,8 @@
 package cmd
 
 import (
-	"github.com/code-ready/crc/pkg/crc/output"
+	"fmt"
+
 	"github.com/spf13/cobra"
 )
 
@@ -28,6 +29,6 @@ func runIP(arguments []string) error {
 	if err != nil {
 		return err
 	}
-	output.Outln(ip)
+	fmt.Println(ip)
 	return nil
 }
diff --git a/cmd/crc/cmd/oc_env.go b/cmd/crc/cmd/oc_env.go
index 09495bf92..b9ae212df 100644
--- a/cmd/crc/cmd/oc_env.go
+++ b/cmd/crc/cmd/oc_env.go
@@ -4,7 +4,6 @@ import (
 	"fmt"
 
 	"github.com/code-ready/crc/pkg/crc/constants"
-	"github.com/code-ready/crc/pkg/crc/output"
 	"github.com/code-ready/crc/pkg/os/shell"
 	"github.com/spf13/cobra"
 )
@@ -34,13 +33,13 @@ func runOcEnv(args []string) error {
 		return err
 	}
 	proxyConfig := consoleResult.ClusterConfig.ProxyConfig
-	output.Outln(shell.GetPathEnvString(userShell, constants.CrcOcBinDir))
+	fmt.Println(shell.GetPathEnvString(userShell, constants.CrcOcBinDir))
 	if proxyConfig.IsEnabled() {
-		output.Outln(shell.GetEnvString(userShell, "HTTP_PROXY", proxyConfig.HTTPProxy))
-		output.Outln(shell.GetEnvString(userShell, "HTTPS_PROXY", proxyConfig.HTTPSProxy))
-		output.Outln(shell.GetEnvString(userShell, "NO_PROXY", proxyConfig.GetNoProxyString()))
+		fmt.Println(shell.GetEnvString(userShell, "HTTP_PROXY", proxyConfig.HTTPProxy))
+		fmt.Println(shell.GetEnvString(userShell, "HTTPS_PROXY", proxyConfig.HTTPSProxy))
+		fmt.Println(shell.GetEnvString(userShell, "NO_PROXY", proxyConfig.GetNoProxyString()))
 	}
-	output.Outln(shell.GenerateUsageHint(userShell, "crc oc-env"))
+	fmt.Println(shell.GenerateUsageHint(userShell, "crc oc-env"))
 	return nil
 }
 
diff --git a/cmd/crc/cmd/podman_env.go b/cmd/crc/cmd/podman_env.go
index ad37ea0f4..2a2014b07 100644
--- a/cmd/crc/cmd/podman_env.go
+++ b/cmd/crc/cmd/podman_env.go
@@ -5,7 +5,6 @@ import (
 	"fmt"
 
 	"github.com/code-ready/crc/pkg/crc/constants"
-	"github.com/code-ready/crc/pkg/crc/output"
 	"github.com/code-ready/crc/pkg/os/shell"
 	"github.com/spf13/cobra"
 )
@@ -36,12 +35,12 @@ func RunPodmanEnv(args []string) error {
 		return err
 	}
 
-	output.Outln(shell.GetPathEnvString(userShell, constants.CrcBinDir))
-	output.Outln(shell.GetEnvString(userShell, "PODMAN_USER", constants.DefaultSSHUser))
-	output.Outln(shell.GetEnvString(userShell, "PODMAN_HOST", ip))
-	output.Outln(shell.GetEnvString(userShell, "PODMAN_IDENTITY_FILE", constants.GetPrivateKeyPath()))
-	output.Outln(shell.GetEnvString(userShell, "PODMAN_IGNORE_HOSTS", "1"))
-	output.Outln(shell.GenerateUsageHint(userShell, "crc podman-env"))
+	fmt.Println(shell.GetPathEnvString(userShell, constants.CrcBinDir))
+	fmt.Println(shell.GetEnvString(userShell, "PODMAN_USER", constants.DefaultSSHUser))
+	fmt.Println(shell.GetEnvString(userShell, "PODMAN_HOST", ip))
+	fmt.Println(shell.GetEnvString(userShell, "PODMAN_IDENTITY_FILE", constants.GetPrivateKeyPath()))
+	fmt.Println(shell.GetEnvString(userShell, "PODMAN_IGNORE_HOSTS", "1"))
+	fmt.Println(shell.GenerateUsageHint(userShell, "crc podman-env"))
 	return nil
 }
 
diff --git a/cmd/crc/cmd/root.go b/cmd/crc/cmd/root.go
index 1c2b96adf..4c360a139 100644
--- a/cmd/crc/cmd/root.go
+++ b/cmd/crc/cmd/root.go
@@ -13,7 +13,6 @@ import (
 	"github.com/code-ready/crc/pkg/crc/logging"
 	"github.com/code-ready/crc/pkg/crc/machine"
 	"github.com/code-ready/crc/pkg/crc/network"
-	"github.com/code-ready/crc/pkg/crc/output"
 	"github.com/code-ready/crc/pkg/crc/preflight"
 	"github.com/code-ready/crc/pkg/crc/segment"
 	"github.com/spf13/cobra"
@@ -80,7 +79,7 @@ func runPostrun() {
 }
 
 func runRoot() {
-	output.Outln("No command given")
+	fmt.Println("No command given")
 }
 
 func Execute() {
diff --git a/cmd/crc/cmd/setup.go b/cmd/crc/cmd/setup.go
index d8b5ace93..e0e3946d1 100644
--- a/cmd/crc/cmd/setup.go
+++ b/cmd/crc/cmd/setup.go
@@ -8,6 +8,7 @@ import (
 
 	cmdConfig "github.com/code-ready/crc/cmd/crc/cmd/config"
 	"github.com/code-ready/crc/pkg/crc/constants"
+	"github.com/code-ready/crc/pkg/crc/input"
 	"github.com/code-ready/crc/pkg/crc/preflight"
 	"github.com/spf13/cobra"
 )
@@ -31,6 +32,20 @@ var setupCmd = &cobra.Command{
 }
 
 func runSetup(arguments []string) error {
+	if config.Get(cmdConfig.ConsentTelemetry).AsString() == "" {
+		fmt.Println("CodeReady Containers is constantly improving and we would like to know more about usage!")
+		if input.PromptUserForYesOrNo("Would you like to contribute anonymous usage statistics (more details at https://developers.redhat.com/article/tool-data-collection)", false) {
+			if _, err := config.Set(cmdConfig.ConsentTelemetry, "yes"); err != nil {
+				return err
+			}
+			fmt.Printf("Thanks for helping us! You can disable telemetry with the command 'crc config set %s no'.\n", cmdConfig.ConsentTelemetry)
+		} else {
+			if _, err := config.Set(cmdConfig.ConsentTelemetry, "no"); err != nil {
+				return err
+			}
+			fmt.Printf("No worry, you can still enable telemetry manually with the command 'crc config set %s yes'.\n", cmdConfig.ConsentTelemetry)
+		}
+	}
 	err := preflight.SetupHost(config)
 	return render(&setupResult{
 		Success: err == nil,
diff --git a/pkg/crc/config/config.go b/pkg/crc/config/config.go
index 7cd3cf121..0fe0f538d 100644
--- a/pkg/crc/config/config.go
+++ b/pkg/crc/config/config.go
@@ -9,7 +9,7 @@ import (
 
 const (
 	configPropDoesntExistMsg = "Configuration property '%s' does not exist"
-	invalidProp              = "Value '%s' for configuration property '%s' is invalid, reason: %s"
+	invalidProp              = "Value '%v' for configuration property '%s' is invalid, reason: %s"
 )
 
 type Config struct {
diff --git a/pkg/crc/config/validations.go b/pkg/crc/config/validations.go
index 634c21fe1..5ce5bd6bb 100644
--- a/pkg/crc/config/validations.go
+++ b/pkg/crc/config/validations.go
@@ -95,3 +95,10 @@ func ValidateNoProxy(value interface{}) (bool, string) {
 	}
 	return true, ""
 }
+
+func ValidateYesNo(value interface{}) (bool, string) {
+	if cast.ToString(value) == "yes" || cast.ToString(value) == "no" {
+		return true, ""
+	}
+	return false, "must be yes or no"
+}
diff --git a/pkg/crc/input/input.go b/pkg/crc/input/input.go
index be5086102..7f77c8729 100644
--- a/pkg/crc/input/input.go
+++ b/pkg/crc/input/input.go
@@ -6,7 +6,6 @@ import (
 	"os"
 	"strings"
 
-	"github.com/code-ready/crc/pkg/crc/output"
 	terminal "golang.org/x/term"
 	survey "gopkg.in/AlecAivazis/survey.v1"
 )
@@ -19,7 +18,7 @@ func PromptUserForYesOrNo(message string, force bool) bool {
 		return false
 	}
 	var response string
-	output.Outf(message + "? [y/N]: ")
+	fmt.Printf(message + "? [y/N]: ")
 	fmt.Scanf("%s", &response)
 
 	return strings.ToLower(response) == "y"
diff --git a/pkg/crc/machine/start.go b/pkg/crc/machine/start.go
index ad4b6b641..545c51c18 100644
--- a/pkg/crc/machine/start.go
+++ b/pkg/crc/machine/start.go
@@ -23,7 +23,6 @@ import (
 	"github.com/code-ready/crc/pkg/crc/ssh"
 	crcssh "github.com/code-ready/crc/pkg/crc/ssh"
 	"github.com/code-ready/crc/pkg/crc/systemd"
-	"github.com/code-ready/crc/pkg/crc/systemd/states"
 	crcos "github.com/code-ready/crc/pkg/os"
 	"github.com/code-ready/machine/libmachine"
 	"github.com/code-ready/machine/libmachine/drivers"
@@ -350,12 +349,6 @@ func (client *client) Start(startConfig StartConfig) (*StartResult, error) {
 		}
 	}
 
-	// Check if kubelet service is running inside the VM
-	kubeletStatus, err := sd.Status("kubelet")
-	if err != nil || kubeletStatus != states.Running {
-		return nil, errors.Wrap(err, "kubelet service is not running")
-	}
-
 	// In Openshift 4.3, when cluster comes up, the following happens
 	// 1. After the openshift-apiserver pod is started, its log contains multiple occurrences of `certificate has expired or is not yet valid`
 	// 2. Initially there is no request-header's client-ca crt available to `extension-apiserver-authentication` configmap
diff --git a/pkg/crc/output/output.go b/pkg/crc/output/output.go
deleted file mode 100644
index 80b50f461..000000000
--- a/pkg/crc/output/output.go
+++ /dev/null
@@ -1,18 +0,0 @@
-package output
-
-import (
-	"fmt"
-	"io"
-)
-
-func Outln(args ...interface{}) {
-	fmt.Println(args...)
-}
-
-func Outf(s string, args ...interface{}) {
-	fmt.Printf(s, args...)
-}
-
-func Fout(w io.Writer, args ...interface{}) (n int, err error) {
-	return fmt.Fprintln(w, args...)
-}
diff --git a/pkg/crc/preflight/preflight_checks_tray_darwin.go b/pkg/crc/preflight/preflight_checks_tray_darwin.go
index 05961eee0..ee31ee2fd 100644
--- a/pkg/crc/preflight/preflight_checks_tray_darwin.go
+++ b/pkg/crc/preflight/preflight_checks_tray_darwin.go
@@ -195,7 +195,9 @@ func downloadOrExtractTrayApp() error {
 	}()
 
 	logging.Debug("Trying to extract tray from crc executable")
-	err = embed.Extract(filepath.Base(constants.GetCRCMacTrayDownloadURL()), tmpArchivePath)
+	trayFileName := filepath.Base(constants.GetCRCMacTrayDownloadURL())
+	trayDestFileName := filepath.Join(tmpArchivePath, trayFileName)
+	err = embed.Extract(trayFileName, trayDestFileName)
 	if err != nil {
 		logging.Debug("Could not extract tray from crc executable", err)
 		logging.Debug("Downloading crc tray")
@@ -204,15 +206,14 @@ func downloadOrExtractTrayApp() error {
 			return err
 		}
 	}
-	archivePath := filepath.Join(tmpArchivePath, filepath.Base(constants.GetCRCMacTrayDownloadURL()))
 	outputPath := constants.CrcBinDir
 	err = goos.MkdirAll(outputPath, 0750)
 	if err != nil {
 		return errors.Wrap(err, "Cannot create the target directory.")
 	}
-	_, err = extract.Uncompress(archivePath, outputPath, false)
+	_, err = extract.Uncompress(trayDestFileName, outputPath, false)
 	if err != nil {
-		return errors.Wrapf(err, "Cannot uncompress '%s'", archivePath)
+		return errors.Wrapf(err, "Cannot uncompress '%s'", trayDestFileName)
 	}
 	return nil
 }
diff --git a/pkg/crc/preflight/preflight_checks_tray_windows.go b/pkg/crc/preflight/preflight_checks_tray_windows.go
index 501984608..d2493018d 100644
--- a/pkg/crc/preflight/preflight_checks_tray_windows.go
+++ b/pkg/crc/preflight/preflight_checks_tray_windows.go
@@ -161,7 +161,9 @@ func fixTrayExecutableExists() error {
 	}()
 
 	logging.Debug("Trying to extract tray from crc executable")
-	err = embed.Extract(filepath.Base(constants.GetCRCWindowsTrayDownloadURL()), tmpArchivePath)
+	trayFileName := filepath.Base(constants.GetCRCWindowsTrayDownloadURL())
+	trayDestFileName := filepath.Join(tmpArchivePath, trayFileName)
+	err = embed.Extract(trayFileName, trayDestFileName)
 	if err != nil {
 		logging.Debug("Could not extract tray from crc executable", err)
 		logging.Debug("Downloading crc tray")
@@ -170,10 +172,9 @@ func fixTrayExecutableExists() error {
 			return err
 		}
 	}
-	archivePath := filepath.Join(tmpArchivePath, filepath.Base(constants.GetCRCWindowsTrayDownloadURL()))
-	_, err = extract.Uncompress(archivePath, constants.TrayExecutableDir, false)
+	_, err = extract.Uncompress(trayDestFileName, constants.TrayExecutableDir, false)
 	if err != nil {
-		return fmt.Errorf("Cannot uncompress '%s': %v", archivePath, err)
+		return fmt.Errorf("Cannot uncompress '%s': %v", trayDestFileName, err)
 	}
 
 	return nil
diff --git a/pkg/crc/segment/segment.go b/pkg/crc/segment/segment.go
index e9ac423c4..f81d6131c 100644
--- a/pkg/crc/segment/segment.go
+++ b/pkg/crc/segment/segment.go
@@ -56,7 +56,7 @@ func (c *Client) Close() error {
 }
 
 func (c *Client) Upload(action string, duration time.Duration, err error) error {
-	if !c.config.Get(config.ConsentTelemetry).AsBool() {
+	if c.config.Get(config.ConsentTelemetry).AsString() != "yes" {
 		return nil
 	}
 


Test patch:
diff --git a/pkg/crc/segment/segment_test.go b/pkg/crc/segment/segment_test.go
index abc799f97..0eabde50c 100644
--- a/pkg/crc/segment/segment_test.go
+++ b/pkg/crc/segment/segment_test.go
@@ -60,7 +60,7 @@ func mockServer() (chan []byte, *httptest.Server) {
 	return done, server
 }
 
-func newTestConfig(value bool) (*crcConfig.Config, error) {
+func newTestConfig(value string) (*crcConfig.Config, error) {
 	storage := crcConfig.NewEmptyInMemoryStorage()
 	config := crcConfig.New(storage)
 	cmdConfig.RegisterSettings(config)
@@ -80,7 +80,7 @@ func TestClientUploadWithConsent(t *testing.T) {
 	require.NoError(t, err)
 	defer os.RemoveAll(dir)
 
-	config, err := newTestConfig(true)
+	config, err := newTestConfig("yes")
 	require.NoError(t, err)
 
 	c, err := newCustomClient(config, filepath.Join(dir, "telemetry"), server.URL)
@@ -113,7 +113,7 @@ func TestClientUploadWithOutConsent(t *testing.T) {
 	require.NoError(t, err)
 	defer os.RemoveAll(dir)
 
-	config, err := newTestConfig(false)
+	config, err := newTestConfig("no")
 	require.NoError(t, err)
 
 	c, err := newCustomClient(config, filepath.Join(dir, "telemetry"), server.URL)