Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
AstroProfundis committed May 6, 2021
1 parent e765a75 commit 70dfc4a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func Execute() {
teleReport.InstallationUUID = teleMeta.UUID
} // default to false on errors
}
fmt.Println(reportEnabled)

if reportEnabled {
teleReport.EventUUID = eventUUID
teleReport.EventUnixTimestamp = start.Unix()
Expand Down
6 changes: 3 additions & 3 deletions components/cluster/command/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ var cm *manager.Manager
func scrubClusterName(n string) string {
// prepend the telemetry secret to cluster name, so that two installations
// of tiup with the same cluster name produce different hashes
cls := telemetry.GetTelemetrySecret() + ":" + n
cls := telemetry.GetSecret() + ":" + n
return "cluster_" + telemetry.HashReport(cls)
}

Expand Down Expand Up @@ -249,7 +249,7 @@ func Execute() {
if eventUUID == "" {
eventUUID = uuid.New().String()
}
teleReport.InstallationUUID = telemetry.GetTelemetryUUID()
teleReport.InstallationUUID = telemetry.GetUUID()
teleReport.EventUUID = eventUUID
teleReport.EventUnixTimestamp = time.Now().Unix()
teleReport.Version = telemetry.TiUPMeta()
Expand Down Expand Up @@ -292,7 +292,7 @@ func Execute() {
"config": {},
"server_configs": {},
}, // fields to omit
telemetry.GetTelemetrySecret(),
telemetry.GetSecret(),
); err == nil {
clusterReport.Topology = (string(data))
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/telemetry/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ func Enabled() bool {
return status == EnableStatus
}

// GetTelemetryUUID return telemetry uuid.
func GetTelemetryUUID() string {
// GetUUID return telemetry uuid.
func GetUUID() string {
return os.Getenv(localdata.EnvNameTelemetryUUID)
}

// GetTelemetrySecret return telemetry uuid.
func GetTelemetrySecret() string {
// GetSecret return telemetry encrypt secret.
func GetSecret() string {
return os.Getenv(localdata.EnvNameTelemetrySecret)
}

Expand Down

0 comments on commit 70dfc4a

Please sign in to comment.