Skip to content

Helm Capability check for ServiceMonitor only checks for GroupVersion instead of GroupVersionKind #5058

@l0wl3vel

Description

@l0wl3vel

Describe the bug

ServiceMonitors are part of the monitoring.coreos.com/v1 GroupVersion. A GroupVersion is also satisfied when a cluster has any CustomResourceDefinition (e.g. PodMonitor) in the GroupVersion installed.

When trying to install external-secrets using Helm the install failes, since the check for the GroupVersion instead of the GroupVersionKind monitoring.coreos.com/v1/ServiceMonitor.

To Reproduce
Steps to reproduce the behavior:

  1. kubectl apply -f https://raw.githubusercontent.com/prometheus-community/helm-charts/refs/heads/main/charts/kube-prometheus-stack/charts/crds/crds/crd-podmonitors.yaml
  2. helm install external-secrets external-secrets/external-secrets --set serviceMonitor.enabled=true
  3. The following error ocurrs:
Error: INSTALLATION FAILED: unable to build kubernetes objects from release manifest: [resource mapping not found for name: "external-secrets-metrics" namespace: "default" from "": no matches for kind "ServiceMonitor" in version "monitoring.coreos.com/v1"
ensure CRDs are installed first, resource mapping not found for name: "external-secrets-webhook-metrics" namespace: "default" from "": no matches for kind "ServiceMonitor" in version "monitoring.coreos.com/v1"
ensure CRDs are installed first, resource mapping not found for name: "external-secrets-cert-controller-metrics" namespace: "default" from "": no matches for kind "ServiceMonitor" in version "monitoring.coreos.com/v1"
ensure CRDs are installed first]

Expected behavior
The ServiceMonitor resource is not rendered and the helm install command finishes without errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomerskind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions