From 921c315975bc10d8ef236b92df64309ed6087820 Mon Sep 17 00:00:00 2001 From: Bipul Adhikari Date: Mon, 22 Jan 2024 13:59:48 +0545 Subject: [PATCH] console: Fixes update issue in ConsolePlugin ConsolePlugin gets correctly updated in upgrade scenarios Signed-off-by: Bipul Adhikari --- controllers/clusterversion_controller.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/controllers/clusterversion_controller.go b/controllers/clusterversion_controller.go index c87227b8e..3a4073847 100644 --- a/controllers/clusterversion_controller.go +++ b/controllers/clusterversion_controller.go @@ -30,6 +30,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/manager" + consolev1alpha1 "github.com/openshift/api/console/v1alpha1" "github.com/red-hat-storage/odf-operator/console" "github.com/red-hat-storage/odf-operator/pkg/util" ) @@ -129,6 +130,20 @@ func (r *ClusterVersionReconciler) ensureConsolePlugin(clusterVersion string) er logger.Info(fmt.Sprintf("Set the BasePath for odf-console plugin as '%s'", basePath)) odfConsolePlugin.Spec.Service.BasePath = basePath } + if odfConsolePlugin.Spec.Proxy == nil { + odfConsolePlugin.Spec.Proxy = []consolev1alpha1.ConsolePluginProxy{ + { + Type: consolev1alpha1.ProxyTypeService, + Alias: "provider-proxy", + Service: consolev1alpha1.ConsolePluginProxyServiceConfig{ + Name: "ux-backend-proxy", + Namespace: OperatorNamespace, + Port: 8888, + }, + Authorize: true, + }, + } + } return nil }) if err != nil && !errors.IsAlreadyExists(err) {