From 86293a94cb020a46182921223d7c70e41b23b096 Mon Sep 17 00:00:00 2001 From: VOID404 Date: Fri, 22 Nov 2024 08:56:39 +0100 Subject: [PATCH] Reorder fields and logs --- internal/controller/runtime/runtime_controller.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/controller/runtime/runtime_controller.go b/internal/controller/runtime/runtime_controller.go index e3080b43..9be9a584 100644 --- a/internal/controller/runtime/runtime_controller.go +++ b/internal/controller/runtime/runtime_controller.go @@ -57,8 +57,6 @@ func (r *RuntimeReconciler) Reconcile(ctx context.Context, request ctrl.Request) }, client.IgnoreNotFound(err) } - r.Log.Info("Reconciling Runtime", "Name", runtime.Name, "Namespace", runtime.Namespace) - runtimeID, ok := runtime.Labels["kyma-project.io/runtime-id"] if !ok { runtimeID = runtime.Name @@ -69,8 +67,11 @@ func (r *RuntimeReconciler) Reconcile(ctx context.Context, request ctrl.Request) shootName = "N/D" } + log := r.Log.WithValues("runtime", runtimeID, "shoot", shootName) + log.Info("Reconciling Runtime", "Name", runtime.Name, "Namespace", runtime.Namespace) + stateFSM := fsm.NewFsm( - r.Log.WithName(fmt.Sprintf("reqID %d", requCounter)).WithValues("runtime", runtimeID, "shoot", shootName), + log.WithName(fmt.Sprintf("reqID %d", requCounter)), r.Cfg, fsm.K8s{ Client: r.Client,