Skip to content

Commit

Permalink
explicitly set no-op logger for controller-runtime to avoid warning m…
Browse files Browse the repository at this point in the history
…essage
  • Loading branch information
erhancagirici committed Dec 6, 2023
1 parent e7c2c1e commit e0b38df
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/provider/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package main

import (
"io"
"os"
"path/filepath"
"time"
Expand Down Expand Up @@ -63,6 +64,9 @@ func main() {
// *very* verbose even at info level, so we only provide it a real
// logger when we're running in debug mode.
ctrl.SetLogger(zl)
} else {
// explicitly provide a no-op logger by default, otherwise controller-runtime gives a warning
ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard)))
}

cfg, err := ctrl.GetConfig()
Expand Down

0 comments on commit e0b38df

Please sign in to comment.