From 6bb6b07b18532c02270d82a0cec650b31da81e33 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Fri, 12 Apr 2024 11:01:42 +0200 Subject: [PATCH] e2e node: fix -v support Since 43539c855f59f3318de73602d091c62ee5863cda (first released in v1.30.0-alpha.2), the test/e2e/framework manages -v and -vmodule and uses them for a logger which writes to the Ginkgo output stream. This did not work for test/e2e_node, because: - logs.AddFlags(pflag.CommandLine) registers its own -v and -vmodule flags - pflag.CommandLine.AddGoFlagSet(flag.CommandLine) skips the corresponding flags in the flag.CommandLine - pflag.Parse() initializes the settings in the "logs" package even though those are not used at runtime The solution is to not use the "logs" package. --- test/e2e_node/e2e_node_suite_test.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/e2e_node/e2e_node_suite_test.go b/test/e2e_node/e2e_node_suite_test.go index cd559b1b97c..0bd8f9d4066 100644 --- a/test/e2e_node/e2e_node_suite_test.go +++ b/test/e2e_node/e2e_node_suite_test.go @@ -41,7 +41,6 @@ import ( utilfeature "k8s.io/apiserver/pkg/util/feature" clientset "k8s.io/client-go/kubernetes" cliflag "k8s.io/component-base/cli/flag" - "k8s.io/component-base/logs" "k8s.io/kubernetes/pkg/util/rlimit" commontest "k8s.io/kubernetes/test/e2e/common" "k8s.io/kubernetes/test/e2e/framework" @@ -123,7 +122,6 @@ func TestMain(m *testing.M) { e2econfig.CopyFlags(e2econfig.Flags, flag.CommandLine) framework.RegisterCommonFlags(flag.CommandLine) registerNodeFlags(flag.CommandLine) - logs.AddFlags(pflag.CommandLine) pflag.CommandLine.AddGoFlagSet(flag.CommandLine) // Mark the run-services-mode flag as hidden to prevent user from using it. pflag.CommandLine.MarkHidden("run-services-mode")