Skip to content

Commit d683615

Browse files
committed
USHIFT-5297: Disable telemetry if pull secrets are not available
1 parent 99e525d commit d683615

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

pkg/controllers/telemetry.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,17 @@ func (t *TelemetryManager) Run(ctx context.Context, ready chan<- struct{}, stopp
6161
if err != nil {
6262
return fmt.Errorf("unable to get cluster id: %v", err)
6363
}
64-
pullSecret, err := readPullSecret()
65-
if err != nil {
66-
return fmt.Errorf("unable to get pull secret: %v", err)
67-
}
6864

69-
_ = telemetry.NewTelemetryClient(t.config.Telemetry.Endpoint, clusterId, pullSecret)
7065
go func() {
66+
67+
pullSecret, err := readPullSecret()
68+
if err != nil {
69+
klog.Infof("Disabling telemetry: unable to get pull secret: %v", err)
70+
return
71+
}
72+
73+
_ = telemetry.NewTelemetryClient(t.config.Telemetry.Endpoint, clusterId, pullSecret)
74+
7175
klog.Infof("First metrics collection")
7276
for {
7377
select {

0 commit comments

Comments
 (0)