feat(argo-workflows): check prometheus CRD for ServiceMonitor (#2430)

* chore: Apply changes from code review

Signed-off-by: Marco Maurer <mkilchhofer@users.noreply.github.com>

---------

Signed-off-by: cmontemuino <1761056+cmontemuino@users.noreply.github.com>
Signed-off-by: Marco Maurer <mkilchhofer@users.noreply.github.com>
Co-authored-by: Jason Meridth <jmeridth@gmail.com>
Co-authored-by: Marco Maurer <mkilchhofer@users.noreply.github.com>
This commit is contained in:
Carlos M 2024-03-24 21:26:55 +01:00 committed by GitHub
parent 19b3d72718
commit a28780fb19
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 19 additions and 4 deletions

View file

@ -1,5 +1,6 @@
{{- if and (or .Values.controller.metricsConfig.enabled .Values.controller.telemetryConfig.enabled) .Values.controller.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
{{- $apiVersion := include "argo-workflows.apiVersions.monitoring" . }}
{{- if and (.Capabilities.APIVersions.Has $apiVersion) (or .Values.controller.metricsConfig.enabled .Values.controller.telemetryConfig.enabled) .Values.controller.serviceMonitor.enabled }}
apiVersion: {{ $apiVersion }}
kind: ServiceMonitor
metadata:
name: {{ template "argo-workflows.controller.fullname" . }}