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 authored and squakez committed Sep 20, 2023
1 parent 3c48ca8 commit 3079a0e
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 3079a0e

Please sign in to comment.