Skip to content

Commit

Permalink
Setting logger to avoid error comming from controller-runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
ljakimczuk committed Jan 14, 2025
1 parent f8fc0a2 commit abdb7aa
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (
"github.com/giantswarm/micrologger"
"github.com/spf13/afero"
"github.com/spf13/viper"
cr "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/log/zap"

"github.com/giantswarm/app-operator/v7/flag"
"github.com/giantswarm/app-operator/v7/pkg/env"
Expand Down Expand Up @@ -64,8 +66,13 @@ func New(config Config) (*Service, error) {
return nil, microerror.Maskf(invalidConfigError, "%T.Viper must not be empty", config)
}

var err error
// Configure controller-runtime logger
opts := zap.Options{
Development: true,
}
cr.SetLogger(zap.New(zap.UseFlagOptions(&opts)))

var err error
var catalogController *catalog.Catalog
{
c := catalog.Config{
Expand Down

0 comments on commit abdb7aa

Please sign in to comment.