Skip to content

Commit

Permalink
prevent controller runtime complaining about SetupLogger() was never …
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviassss authored May 29, 2024
1 parent e5c21db commit f5dee3f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/framework/utils/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package utils

import (
"fmt"
logf "sigs.k8s.io/controller-runtime/pkg/log"

httpexpectv2 "github.com/gavv/httpexpect/v2"
"github.com/go-logr/logr"
Expand Down Expand Up @@ -39,5 +40,7 @@ func NewGinkgoLogger() (logr.Logger, httpexpectv2.LoggerReporter) {
zap.Level(zapraw.InfoLevel),
zap.WriteTo(ginkgov2.GinkgoWriter),
zap.Encoder(encoder))
// this line is to prevent controller runtime complaining about SetupLogger() was never called
logf.SetLogger(logger)
return logger, &defaultGinkgoLogger{logger: logger}
}

0 comments on commit f5dee3f

Please sign in to comment.