@@ -29,6 +29,7 @@ import (
29
29
30
30
"github.com/operator-framework/operator-sdk/internal/testutils"
31
31
"github.com/operator-framework/operator-sdk/internal/util/projutil"
32
+ kbutil "sigs.k8s.io/kubebuilder/v4/pkg/plugin/util"
32
33
)
33
34
34
35
// TestIntegration tests operator-sdk projects with OLM.
@@ -73,6 +74,20 @@ var _ = BeforeSuite(func() {
73
74
By ("installing prometheus-operator" )
74
75
Expect (tc .InstallPrometheusOperManager ()).To (Succeed ())
75
76
77
+ // Previously, we used kube-rbac-proxy, which generated TLS certificates on the fly —
78
+ // a practice not recommended and also deprecated on it due this reason.
79
+ //
80
+ // Newer versions of the scaffolding support passing real certificates to the metrics server
81
+ // using cert-manager. However, the `packagemanifests` command does not support this capability.
82
+ // Since `packagemanifests` is deprecated and will be removed in the future, we are choosing
83
+ // not to implement support for cert-manager in this context.
84
+ //
85
+ // Therefore, for testing purposes — specifically when using `packagemanifests` — we are
86
+ // disabling the metrics server with cert-manager.
87
+ By ("Disabling metrics with certs - no supported by packagemanifests" )
88
+ // nolint: errcheck
89
+ kbutil .CommentCode (filepath .Join (tc .Dir , "config" , "default" , "kustomization.yaml" ), targetMetricsCertFragment , "#" )
90
+
76
91
By ("building the manager image" )
77
92
Expect (tc .Make ("docker-build" , "IMG=" + tc .ImageName )).To (Succeed ())
78
93
@@ -109,6 +124,10 @@ var _ = BeforeSuite(func() {
109
124
Expect (err ).NotTo (HaveOccurred ())
110
125
})
111
126
127
+ const targetMetricsCertFragment = `- path: cert_metrics_manager_patch.yaml
128
+ target:
129
+ kind: Deployment`
130
+
112
131
var _ = AfterSuite (func () {
113
132
By ("uninstalling OLM" )
114
133
tc .UninstallOLM ()
0 commit comments