Skip to content

Commit

Permalink
Assume telemeter client is enabled if no cluster monitoring config ex…
Browse files Browse the repository at this point in the history
…ists
  • Loading branch information
TheRealJon committed Mar 20, 2024
1 parent bd1fcc7 commit dc788e0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/console/subresource/configmap/cluster_monitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type ClusterMonitoringConfiguration struct {
func GetTelemeterClientConfig(cm *v1.ConfigMap) *TelemeterClientConfig {
cfg := &ClusterMonitoringConfiguration{}

if cm == nil || cm.Data == nil {
if cm.Data == nil {
return nil
}

Expand All @@ -40,6 +40,11 @@ func GetTelemeterClientConfig(cm *v1.ConfigMap) *TelemeterClientConfig {
}

func TelemeterClientIsEnabled(cm *v1.ConfigMap) bool {
// If no config exists that is disabling or overriding the telemeter client, assume it's enabled
if cm == nil {
return true
}

c := GetTelemeterClientConfig(cm)
if c == nil {
return false
Expand Down

0 comments on commit dc788e0

Please sign in to comment.