From cad6d2002f99bed6f1e51af68991b4533476ab9c Mon Sep 17 00:00:00 2001 From: Francesco Cheinasso Date: Wed, 2 Oct 2024 20:50:56 +0200 Subject: [PATCH] Added controller name for external-configuration-controller --- cmd/liqo-controller-manager/modules/networking.go | 2 +- .../external-network/route/configuration_controller.go | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/liqo-controller-manager/modules/networking.go b/cmd/liqo-controller-manager/modules/networking.go index a236039035..117993e9bc 100644 --- a/cmd/liqo-controller-manager/modules/networking.go +++ b/cmd/liqo-controller-manager/modules/networking.go @@ -84,7 +84,7 @@ func SetupNetworkingModule(ctx context.Context, mgr manager.Manager, opts *Netwo extCfgReconciler := externalnetworkroute.NewConfigurationReconciler(mgr.GetClient(), mgr.GetScheme(), mgr.GetEventRecorderFor("external-configuration-controller")) if err := extCfgReconciler.SetupWithManager(mgr); err != nil { - klog.Errorf("unable to create controller externalConfigurationReconciler: %s", err) + klog.Errorf("unable to create controller %s: %s", externalnetworkroute.ControllerName, err) return err } diff --git a/pkg/liqo-controller-manager/networking/external-network/route/configuration_controller.go b/pkg/liqo-controller-manager/networking/external-network/route/configuration_controller.go index a4c07c368c..5badc6d90a 100644 --- a/pkg/liqo-controller-manager/networking/external-network/route/configuration_controller.go +++ b/pkg/liqo-controller-manager/networking/external-network/route/configuration_controller.go @@ -36,6 +36,9 @@ import ( "github.com/liqotech/liqo/pkg/utils/getters" ) +// ControllerName is the name of the controller. +const ControllerName = "externalConfiguration" + // ConfigurationReconciler manage Configuration. type ConfigurationReconciler struct { client.Client @@ -90,7 +93,7 @@ func (r *ConfigurationReconciler) SetupWithManager(mgr ctrl.Manager) error { if err != nil { return err } - return ctrl.NewControllerManagedBy(mgr). + return ctrl.NewControllerManagedBy(mgr).Named(ControllerName). For(&networkingv1beta1.Configuration{}, builder.WithPredicates(p)). Watches( &networkingv1beta1.GatewayServer{},