Skip to content

Commit

Permalink
added logger to unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
anirudhprasad-sap committed Sep 7, 2023
1 parent 8101146 commit fb9d52f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/operator/operator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/log/zap"

fakediscovery "k8s.io/client-go/discovery/fake"
fakeclientset "k8s.io/client-go/kubernetes/fake"
Expand Down Expand Up @@ -57,6 +58,14 @@ func TestOperator(t *testing.T) {

operator.InitScheme(scheme)

opts := zap.Options{
Development: false,
}
opts.BindFlags(flag.CommandLine)
flag.Parse()

ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))

var chartDir string
var enableLeaderElection bool

Expand Down

0 comments on commit fb9d52f

Please sign in to comment.