Skip to content

Commit

Permalink
fix: set defaults + remove extra spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
dexter0195 committed Dec 28, 2024
1 parent b07ad6b commit 7d1f53f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
4 changes: 4 additions & 0 deletions apis/v1beta1/targetallocator_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ type TargetAllocatorPrometheusCR struct {
// matchExpressions are ANDed. An empty label selector matches all objects. A null
// label selector matches no objects.
// +optional
// +kubebuilder:default:={}
PodMonitorNamespaceSelector *metav1.LabelSelector `json:"podMonitorNamespaceSelector,omitempty"`
// ServiceMonitors to be selected for target discovery.
// A label selector is a label query over a set of resources. The result of matchLabels and
Expand All @@ -53,6 +54,7 @@ type TargetAllocatorPrometheusCR struct {
// matchExpressions are ANDed. An empty label selector matches all objects. A null
// label selector matches no objects.
// +optional
// +kubebuilder:default:={}
ServiceMonitorNamespaceSelector *metav1.LabelSelector `json:"serviceMonitorNamespaceSelector,omitempty"`
// ScrapeConfigs to be selected for target discovery.
// A label selector is a label query over a set of resources. The result of matchLabels and
Expand All @@ -65,6 +67,7 @@ type TargetAllocatorPrometheusCR struct {
// matchExpressions are ANDed. An empty label selector matches all objects. A null
// label selector matches no objects.
// +optional
// +kubebuilder:default:={}
ScrapeConfigNamespaceSelector *metav1.LabelSelector `json:"scrapeConfigNamespaceSelector,omitempty"`
// Probes to be selected for target discovery.
// A label selector is a label query over a set of resources. The result of matchLabels and
Expand All @@ -77,6 +80,7 @@ type TargetAllocatorPrometheusCR struct {
// matchExpressions are ANDed. An empty label selector matches all objects. A null
// label selector matches no objects.
// +optional
// +kubebuilder:default:={}
ProbeNamespaceSelector *metav1.LabelSelector `json:"probeNamespaceSelector,omitempty"`
}

Expand Down
9 changes: 0 additions & 9 deletions internal/manifests/targetallocator/configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,23 +104,14 @@ func ConfigMap(params Params) (*corev1.ConfigMap, error) {
if taSpec.PrometheusCR.ScrapeInterval.Size() > 0 {
prometheusCRConfig["scrape_interval"] = taSpec.PrometheusCR.ScrapeInterval.Duration
}

prometheusCRConfig["service_monitor_selector"] = taSpec.PrometheusCR.ServiceMonitorSelector

prometheusCRConfig["service_monitor_namespace_selector"] = taSpec.PrometheusCR.ServiceMonitorNamespaceSelector

prometheusCRConfig["pod_monitor_selector"] = taSpec.PrometheusCR.PodMonitorSelector

prometheusCRConfig["pod_monitor_namespace_selector"] = taSpec.PrometheusCR.PodMonitorNamespaceSelector

prometheusCRConfig["scrape_config_selector"] = taSpec.PrometheusCR.ScrapeConfigSelector

prometheusCRConfig["scrape_config_namespace_selector"] = taSpec.PrometheusCR.ScrapeConfigNamespaceSelector

prometheusCRConfig["probe_selector"] = taSpec.PrometheusCR.ProbeSelector

prometheusCRConfig["probe_namespace_selector"] = taSpec.PrometheusCR.ProbeNamespaceSelector

taConfig["prometheus_cr"] = prometheusCRConfig
}

Expand Down

0 comments on commit 7d1f53f

Please sign in to comment.