Skip to content

Commit

Permalink
Add Monitoring coreos.com custom resources to the scheme
Browse files Browse the repository at this point in the history
When Prometheus Redpanda helm chart dependency is enabled, then DecodeYAMLFrom
is not working due to missing ServiceMonitor custom resource in scheme.
```
=== CONT  TestConfigMap/14-prometheus-no-tls-values.yaml
    chart_test.go:182:
        	Error Trace:	/Users/rafalkorepta/workspace/redpanda/helm-charts/charts/redpanda/chart_test.go:182
        	Error:      	Received unexpected error:
        	            	no kind "ServiceMonitor" is registered for version "monitoring.coreos.com/v1" in scheme "pkg/runtime/scheme.go:100"
        	Test:       	TestConfigMap/14-prometheus-no-tls-values.yaml
    --- FAIL: TestConfigMap/14-prometheus-no-tls-values.yaml (0.08s)
```
  • Loading branch information
RafalKorepta committed Jun 17, 2024
1 parent 2e38275 commit 6df252f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions charts/redpanda/chart.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
_ "embed"

certmanagerv1 "github.com/cert-manager/cert-manager/pkg/apis/certmanager/v1"
monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
"github.com/redpanda-data/helm-charts/pkg/gotohelm/helmette"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/kubernetes/scheme"
Expand All @@ -25,6 +26,7 @@ var (
func init() {
must(scheme.AddToScheme(Scheme))
must(certmanagerv1.AddToScheme(Scheme))
must(monitoringv1.AddToScheme(Scheme))

// NB: We can't directly unmarshal into a helmette.Chart as adding json
// tags to it breaks gotohelm.
Expand Down

0 comments on commit 6df252f

Please sign in to comment.