Skip to content

Commit 832febb

Browse files
committed
logs and better changelog
1 parent e5988c5 commit 832febb

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.chloggen/disable-looking-for-podmonitor-servicemonitor-when-not-needed.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ change_type: bug_fix
55
component: collector
66

77
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
8-
note: resolves a problem for trying to use a scheme that isn't present.
8+
note: Introduces ability to detect presence of Prometheus CRDs to dynamically add to scheme to prevent startup issues.
99

1010
# One or more tracking issues related to the change
1111
issues: [2180]

main.go

+6
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,16 @@ func main() {
224224
}
225225
// Only add these to the scheme if they are available
226226
if cfg.PrometheusCRAvailability() == prometheus.Available {
227+
setupLog.Info("Prometheus CRDs are installed, adding to scheme.")
227228
utilruntime.Must(monitoringv1.AddToScheme(scheme))
229+
} else {
230+
setupLog.Info("Prometheus CRDs are not installed, skipping adding to scheme.")
228231
}
229232
if cfg.OpenShiftRoutesAvailability() == openshift.RoutesAvailable {
233+
setupLog.Info("Openshift CRDs are installed, adding to scheme.")
230234
utilruntime.Must(routev1.Install(scheme))
235+
} else {
236+
setupLog.Info("Openshift CRDs are not installed, skipping adding to scheme.")
231237
}
232238

233239
var namespaces map[string]cache.Config

0 commit comments

Comments
 (0)