From fe8ae02a66a76e1a0ba55655227462e46b5430f0 Mon Sep 17 00:00:00 2001 From: Alexander Greene Date: Wed, 20 Oct 2021 19:41:06 -0700 Subject: [PATCH] Use arguments to configure pprof-secret Problem: The secret used to establish a secure connection with OLM's pprof endpoint is hardcoded to the openshift-operator-lifecycle-manager namespace. This cannot work if OLM is not running in that namespace, as is the case on HyperShift clusters. Solutions: Allow users to configure the namespace for the pprof credentials secret. --- cmd/collect-profiles/main.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cmd/collect-profiles/main.go b/cmd/collect-profiles/main.go index a7e3a673bc..89b42c5d0a 100644 --- a/cmd/collect-profiles/main.go +++ b/cmd/collect-profiles/main.go @@ -31,7 +31,6 @@ import ( const ( profileConfigMapLabelKey = "olm.openshift.io/pprof" - olmNamespace = "openshift-operator-lifecycle-manager" pprofSecretName = "pprof-cert" ) @@ -318,7 +317,7 @@ func requestURLBody(httpClient *http.Client, u *url.URL) ([]byte, error) { func populateServingCert(ctx context.Context, client client.Client) error { secret := &corev1.Secret{} - err := client.Get(ctx, types.NamespacedName{Namespace: olmNamespace, Name: pprofSecretName}, secret) + err := client.Get(ctx, types.NamespacedName{Namespace: namespace, Name: pprofSecretName}, secret) if err != nil { return err }