File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -456,15 +456,24 @@ func (p *Profile) IsTelemetryEnabledSet() bool {
456
456
// TelemetryEnabled get the configured telemetry enabled value.
457
457
func TelemetryEnabled () bool { return Default ().TelemetryEnabled () }
458
458
func (p * Profile ) TelemetryEnabled () bool {
459
+ if ToolName != AtlasCLI || ! isTelemetryFeatureFlagSet () {
460
+ return false
461
+ }
459
462
return p .GetBool (telemetryEnabled )
460
463
}
461
464
462
465
// SetTelemetryEnabled sets the telemetry enabled value.
463
466
func SetTelemetryEnabled (v bool ) { Default ().SetTelemetryEnabled (v ) }
464
467
func (p * Profile ) SetTelemetryEnabled (v bool ) {
465
- if ToolName == AtlasCLI {
466
- SetGlobal ( telemetryEnabled , v )
468
+ if ToolName != AtlasCLI || ! isTelemetryFeatureFlagSet () {
469
+ return
467
470
}
471
+ SetGlobal (telemetryEnabled , v )
472
+ }
473
+
474
+ func isTelemetryFeatureFlagSet () bool {
475
+ _ , featureFlagSet := os .LookupEnv ("MONGODB_ATLAS_TELEMETRY_FEATURE_FLAG" )
476
+ return featureFlagSet
468
477
}
469
478
470
479
// Output get configured output format.
You can’t perform that action at this time.
0 commit comments