diff --git a/internal/controller/runtime/runtime_controller.go b/internal/controller/runtime/runtime_controller.go index cbcd3a61..6f36f977 100644 --- a/internal/controller/runtime/runtime_controller.go +++ b/internal/controller/runtime/runtime_controller.go @@ -19,6 +19,7 @@ package runtime import ( "context" "fmt" + "sync/atomic" "github.com/go-logr/logr" imv1 "github.com/kyma-project/infrastructure-manager/api/v1" @@ -39,6 +40,7 @@ type RuntimeReconciler struct { Log logr.Logger Cfg fsm.RCCfg EventRecorder record.EventRecorder + RequestID atomic.Uint64 } //+kubebuilder:rbac:groups=infrastructuremanager.kyma-project.io,resources=runtimes,verbs=get;list;watch;create;update;patch;delete @@ -67,11 +69,11 @@ func (r *RuntimeReconciler) Reconcile(ctx context.Context, request ctrl.Request) shootName = "N/D" } - log := r.Log.WithValues("runtimeID", runtimeID, "shootName", shootName) + log := r.Log.WithValues("runtimeID", runtimeID, "shootName", shootName, "requestID", r.RequestID.Add(1)) log.Info("Reconciling Runtime", "Name", runtime.Name, "Namespace", runtime.Namespace) stateFSM := fsm.NewFsm( - log.WithName(fmt.Sprintf("reqID %d", requCounter)), + log, r.Cfg, fsm.K8s{ Client: r.Client,