Skip to content

Commit

Permalink
discard output from OCI registry client
Browse files Browse the repository at this point in the history
The client has no way to set a verbosity level and spamming the
controller logs with "Login succeeded" every time the object is
reconciled doesn't help much.

Signed-off-by: Max Jonas Werner <mail@makk.es>
  • Loading branch information
Max Jonas Werner committed Apr 28, 2022
1 parent 4c0b077 commit 5db82f6
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package main

import (
"fmt"
"io"
"net"
"net/http"
"os"
Expand Down Expand Up @@ -68,15 +69,6 @@ var (
}
)

type LogWriter struct {
log logr.Logger
}

func (l LogWriter) Write(p []byte) (n int, err error) {
l.log.Info(string(p))
return len(p), nil
}

func init() {
utilruntime.Must(clientgoscheme.AddToScheme(scheme))

Expand Down Expand Up @@ -230,7 +222,7 @@ func main() {
os.Exit(1)
}

rClient, err := registry.NewClient(registry.ClientOptWriter(LogWriter{logger.NewLogger(logger.Options{}).WithName("registry-client")}))
rClient, err := registry.NewClient(registry.ClientOptWriter(io.Discard))
if err != nil {
setupLog.Error(err, "unable to create OCI registry client")
os.Exit(1)
Expand Down

0 comments on commit 5db82f6

Please sign in to comment.