From 3079a0e1f0a7720bdb3c9b8c8723cff0e3b5a115 Mon Sep 17 00:00:00 2001 From: Gaelle Fournier Date: Mon, 18 Sep 2023 10:59:20 +0200 Subject: [PATCH] fix(e2e): init controller-runtime log.SetLogger() --- e2e/support/test_support.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/e2e/support/test_support.go b/e2e/support/test_support.go index 05fc4fb466..f1e97a43c8 100644 --- a/e2e/support/test_support.go +++ b/e2e/support/test_support.go @@ -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" @@ -214,7 +216,6 @@ func init() { gomega.SetDefaultEventuallyTimeout(TestTimeoutShort) // Disable object truncation on test results format.MaxLength = 0 - } func NewTestClient() (client.Client, error) { @@ -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"