Skip to content

Commit

Permalink
fix(e2e): init controller-runtime log.SetLogger()
Browse files Browse the repository at this point in the history
  • Loading branch information
gansheer committed Sep 19, 2023
1 parent 8a40d0b commit 87440e7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion e2e/support/test_support.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ import (

ctrl "sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/client/apiutil"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"

eventing "knative.dev/eventing/pkg/apis/eventing/v1"
messaging "knative.dev/eventing/pkg/apis/messaging/v1"
Expand Down Expand Up @@ -214,7 +216,6 @@ func init() {
gomega.SetDefaultEventuallyTimeout(TestTimeoutShort)
// Disable object truncation on test results
format.MaxLength = 0

}

func NewTestClient() (client.Client, error) {
Expand Down Expand Up @@ -321,6 +322,8 @@ func KamelBindWithContext(ctx context.Context, operatorID string, namespace stri
}

func KamelCommandWithContext(ctx context.Context, command string, operatorID string, namespace string, args ...string) *cobra.Command {
// This line prevents controller-runtime from complaining about log.SetLogger never being called
logf.SetLogger(zap.New(zap.UseDevMode(true)))
var cmdArgs []string

globalTest := os.Getenv("CAMEL_K_FORCE_GLOBAL_TEST") == "true"
Expand Down

0 comments on commit 87440e7

Please sign in to comment.