From c5ff3aaf8df89a90d438502a41b4222ff1d1f747 Mon Sep 17 00:00:00 2001 From: Alex Crawford Date: Thu, 18 Jul 2019 10:55:43 -0700 Subject: [PATCH] asset/cluster: don't record usernames 253126f introduced this so that our telemetry could distinguish between a user, our CI, and other future invokers of the installer. There are privacy concerns around collecting the actual username, so we'll just use "user" instead. --- pkg/asset/cluster/tfvars.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/pkg/asset/cluster/tfvars.go b/pkg/asset/cluster/tfvars.go index c626efa8422..cebf1774a57 100644 --- a/pkg/asset/cluster/tfvars.go +++ b/pkg/asset/cluster/tfvars.go @@ -5,7 +5,6 @@ import ( "encoding/json" "fmt" "os" - "os/user" igntypes "github.com/coreos/ignition/config/v2_2/types" gcpprovider "github.com/openshift/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1" @@ -315,14 +314,9 @@ func injectInstallInfo(bootstrap []byte) (string, error) { return "", errors.Wrap(err, "failed to unmarshal bootstrap Ignition config") } - var invoker string - if env, ok := os.LookupEnv("OPENSHIFT_INSTALL_INVOKER"); ok { + invoker := "user" + if env := os.Getenv("OPENSHIFT_INSTALL_INVOKER"); env != "" { invoker = env - } else if user, err := user.Current(); err == nil { - invoker = user.Username - } else { - logrus.Warnf("Unable to determine username: %v", err) - invoker = "" } config.Storage.Files = append(config.Storage.Files, ignition.FileFromString("/opt/openshift/manifests/openshift-install.yml", "root", 0644, fmt.Sprintf(`---