Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(e2e): init controller-runtime log.SetLogger() #4757

Merged
merged 1 commit into from
Sep 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading