From a1f0de357c38e45849f0ce33fdff3b0ef71917a2 Mon Sep 17 00:00:00 2001 From: Gabriel Bernal Date: Thu, 13 Jun 2024 13:58:27 +0200 Subject: [PATCH] fix: add korrel8r proxy configuration to logging view plugin (#515) --- pkg/controllers/uiplugin/components.go | 8 ++++---- pkg/controllers/uiplugin/logging.go | 10 ++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/pkg/controllers/uiplugin/components.go b/pkg/controllers/uiplugin/components.go index 69cb9ea1..cd208f4e 100644 --- a/pkg/controllers/uiplugin/components.go +++ b/pkg/controllers/uiplugin/components.go @@ -25,6 +25,7 @@ const ( port = 9443 serviceAccountSuffix = "-sa" servingCertVolumeName = "serving-cert" + korrel8rName = "korrel8r" Korrel8rConfigFileName = "korrel8r.yaml" Korrel8rConfigMountDir = "/config/" OpenshiftLoggingNs = "openshift-logging" @@ -79,12 +80,11 @@ func pluginComponentReconcilers(plugin *uiv1alpha1.UIPlugin, pluginInfo UIPlugin } if pluginInfo.Korrel8rImage != "" { - kname := "korrel8r" - components = append(components, reconciler.NewUpdater(newKorrel8rService(kname, namespace), plugin)) - korrel8rCm, err := newKorrel8rConfigMap(kname, namespace, pluginInfo) + components = append(components, reconciler.NewUpdater(newKorrel8rService(korrel8rName, namespace), plugin)) + korrel8rCm, err := newKorrel8rConfigMap(korrel8rName, namespace, pluginInfo) if err == nil && korrel8rCm != nil { components = append(components, reconciler.NewUpdater(korrel8rCm, plugin)) - components = append(components, reconciler.NewUpdater(newKorrel8rDeployment(kname, namespace, pluginInfo), plugin)) + components = append(components, reconciler.NewUpdater(newKorrel8rDeployment(korrel8rName, namespace, pluginInfo), plugin)) } } diff --git a/pkg/controllers/uiplugin/logging.go b/pkg/controllers/uiplugin/logging.go index 544acbdb..2da097f8 100644 --- a/pkg/controllers/uiplugin/logging.go +++ b/pkg/controllers/uiplugin/logging.go @@ -62,6 +62,16 @@ func createLoggingPluginInfo(plugin *uiv1alpha1.UIPlugin, namespace, name, image Port: 8080, }, }, + { + Type: "Service", + Alias: "korrel8r", + Authorize: true, + Service: osv1alpha1.ConsolePluginProxyServiceConfig{ + Name: korrel8rName, + Namespace: namespace, + Port: port, + }, + }, }, ConfigMap: &corev1.ConfigMap{ TypeMeta: metav1.TypeMeta{