Skip to content

Commit 50d94f4

Browse files
Merge pull request #2546 from machine424/tellmore
MON-4107: chore: add logs (at v=3 level) regarding the deactivation of components
2 parents d9384f5 + e404901 commit 50d94f4

File tree

6 files changed

+22
-1
lines changed

6 files changed

+22
-1
lines changed

pkg/tasks/alertmanager.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"fmt"
2020

2121
"k8s.io/apimachinery/pkg/types"
22+
"k8s.io/klog/v2"
2223

2324
"github.com/openshift/cluster-monitoring-operator/pkg/client"
2425
"github.com/openshift/cluster-monitoring-operator/pkg/manifests"
@@ -47,6 +48,7 @@ func (t *AlertmanagerTask) Run(ctx context.Context) error {
4748
return t.create(ctx)
4849
}
4950

51+
klog.V(3).Infof("Main alertmanager is disabled, existing related resources are to be destroyed.")
5052
return t.destroy(ctx)
5153
}
5254

pkg/tasks/alertmanager_user_workload.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"fmt"
2020

2121
"k8s.io/apimachinery/pkg/types"
22+
"k8s.io/klog/v2"
2223

2324
"github.com/openshift/cluster-monitoring-operator/pkg/client"
2425
"github.com/openshift/cluster-monitoring-operator/pkg/manifests"
@@ -47,6 +48,7 @@ func (t *AlertmanagerUserWorkloadTask) Run(ctx context.Context) error {
4748
return t.create(ctx)
4849
}
4950

51+
klog.V(3).Infof("UWM alertmanager is disabled, existing related resources are to be destroyed.")
5052
return t.destroy(ctx)
5153
}
5254

pkg/tasks/prometheus_user_workload.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ func (t *PrometheusUserWorkloadTask) Run(ctx context.Context) error {
4444
return t.create(ctx)
4545
}
4646

47+
klog.V(3).Infof("UWM prometheus is disabled (because UWM is disabled), existing related resources are to be destroyed.")
4748
return t.destroy(ctx)
4849
}
4950

pkg/tasks/prometheusoperator_user_workload.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ import (
1818
"context"
1919
"fmt"
2020

21+
"k8s.io/klog/v2"
22+
2123
"github.com/openshift/cluster-monitoring-operator/pkg/client"
2224
"github.com/openshift/cluster-monitoring-operator/pkg/manifests"
2325
)
@@ -41,6 +43,7 @@ func (t *PrometheusOperatorUserWorkloadTask) Run(ctx context.Context) error {
4143
return t.create(ctx)
4244
}
4345

46+
klog.V(3).Infof("UWM prometheus operator is disabled (because UWM is disabled), existing related resources are to be destroyed.")
4447
return t.destroy(ctx)
4548
}
4649

pkg/tasks/telemeter.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"fmt"
2020

2121
apierrors "k8s.io/apimachinery/pkg/api/errors"
22+
"k8s.io/klog/v2"
2223

2324
"github.com/openshift/cluster-monitoring-operator/pkg/client"
2425
"github.com/openshift/cluster-monitoring-operator/pkg/manifests"
@@ -43,7 +44,16 @@ func (t *TelemeterClientTask) Run(ctx context.Context) error {
4344
return t.create(ctx)
4445
}
4546

46-
if !t.config.ClusterMonitoringConfiguration.TelemeterClientConfig.IsEnabled() || t.config.ClusterMonitoringConfiguration.TelemeterClientConfig.IsEnabled() && t.config.RemoteWrite {
47+
var reason string
48+
switch {
49+
case !t.config.ClusterMonitoringConfiguration.TelemeterClientConfig.IsEnabled():
50+
reason = "telemetry is explicitly disabled"
51+
case t.config.ClusterMonitoringConfiguration.TelemeterClientConfig.IsEnabled() && t.config.RemoteWrite:
52+
reason = "remote-write is enabled instead"
53+
}
54+
55+
if reason != "" {
56+
klog.V(3).Infof("Telemeter client is disabled (because %s), existing related resources are to be destroyed.", reason)
4757
return t.destroy(ctx)
4858
}
4959

pkg/tasks/thanos_ruler_user_workload.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ import (
1818
"context"
1919
"fmt"
2020

21+
"k8s.io/klog/v2"
22+
2123
"github.com/openshift/cluster-monitoring-operator/pkg/client"
2224
"github.com/openshift/cluster-monitoring-operator/pkg/manifests"
2325
)
@@ -41,6 +43,7 @@ func (t *ThanosRulerUserWorkloadTask) Run(ctx context.Context) error {
4143
return t.create(ctx)
4244
}
4345

46+
klog.V(3).Infof("UWM thanos ruler is disabled (because UWM is disabled), existing related resources are to be destroyed.")
4447
return t.destroy(ctx)
4548
}
4649

0 commit comments

Comments
 (0)