From b45fc18f56c06b951a0793293cdbf6148da6e075 Mon Sep 17 00:00:00 2001 From: Rohan CJ Date: Tue, 6 Feb 2024 15:24:19 +0530 Subject: [PATCH] feat: use email as platform id when available Signed-off-by: Rohan CJ --- pkg/telemetry/helpers.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/telemetry/helpers.go b/pkg/telemetry/helpers.go index 3555665b7..89c6293e7 100644 --- a/pkg/telemetry/helpers.go +++ b/pkg/telemetry/helpers.go @@ -115,8 +115,11 @@ func GetPlatformUserID(self *managementv1.Self) string { if cliconfig.GetConfig(log.Discard).TelemetryDisabled || self == nil { return "" } - - return self.Status.Subject + platformID := self.Status.Subject + if self.Status.User != nil && self.Status.User.Email != "" { + platformID = self.Status.User.Email + } + return platformID } // GetPlatformInstanceID returns the loft instance id