Skip to content

Commit

Permalink
Merge pull request #973 from inloco/incident-167
Browse files Browse the repository at this point in the history
Add runner name to context
  • Loading branch information
almirmcunhajr authored Jul 2, 2024
2 parents 528719b + 6cafaf9 commit 44e3f93
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions operator/internal/controller/actionsrunner/wire/wire.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ import (
"github.com/inloco/kube-actions/operator/metrics"
)

type contextKey string

const (
runnerContextKey = contextKey("runner")
)

type Wire struct {
operatorNotifier chan<- event.GenericEvent

Expand Down Expand Up @@ -214,6 +220,7 @@ func (w *Wire) Listen() {

ctx := context.Background()
logger := log.FromContext(ctx, "runner", w.GetRunnerName())
ctx = log.IntoContext(ctx, logger)

w.loopClose = make(chan struct{})
logger.Info("Wire opened")
Expand Down

0 comments on commit 44e3f93

Please sign in to comment.