Skip to content

Commit

Permalink
Reorder fields and logs
Browse files Browse the repository at this point in the history
  • Loading branch information
VOID404 committed Nov 22, 2024
1 parent 32e3626 commit a7e62af
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions internal/controller/runtime/runtime_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ package runtime

import (
"context"
"fmt"

"github.com/go-logr/logr"
imv1 "github.com/kyma-project/infrastructure-manager/api/v1"
"github.com/kyma-project/infrastructure-manager/internal/controller/runtime/fsm"
Expand Down Expand Up @@ -57,8 +55,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
Expand All @@ -69,8 +65,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.Sprintf("reqID %d", requCounter),

Check failure on line 72 in internal/controller/runtime/runtime_controller.go

View workflow job for this annotation

GitHub Actions / govuln

log.Sprintf undefined (type logr.Logger has no field or method Sprintf)

Check failure on line 72 in internal/controller/runtime/runtime_controller.go

View workflow job for this annotation

GitHub Actions / unit-tests

log.Sprintf undefined (type logr.Logger has no field or method Sprintf)

Check failure on line 72 in internal/controller/runtime/runtime_controller.go

View workflow job for this annotation

GitHub Actions / golangci-lint

log.Sprintf undefined (type logr.Logger has no field or method Sprintf))

Check failure on line 72 in internal/controller/runtime/runtime_controller.go

View workflow job for this annotation

GitHub Actions / golangci-lint

log.Sprintf undefined (type logr.Logger has no field or method Sprintf)
r.Cfg,
fsm.K8s{
Client: r.Client,
Expand Down

0 comments on commit a7e62af

Please sign in to comment.