Skip to content

Commit

Permalink
UPSTREAM: <carry>: export HandleFlags
Browse files Browse the repository at this point in the history
openshift-rebase(v1.24):source=d1e53633876
  • Loading branch information
soltysh committed Aug 22, 2022
1 parent 5c25df2 commit 332abdd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
11 changes: 1 addition & 10 deletions test/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import (
"k8s.io/klog/v2"
conformancetestdata "k8s.io/kubernetes/test/conformance/testdata"
"k8s.io/kubernetes/test/e2e/framework"
"k8s.io/kubernetes/test/e2e/framework/config"
"k8s.io/kubernetes/test/e2e/framework/testfiles"
e2etestingmanifests "k8s.io/kubernetes/test/e2e/testing-manifests"
testfixtures "k8s.io/kubernetes/test/fixtures"
Expand All @@ -64,20 +63,12 @@ import (
_ "k8s.io/kubernetes/test/e2e/windows"
)

// handleFlags sets up all flags and parses the command line.
func handleFlags() {
config.CopyFlags(config.Flags, flag.CommandLine)
framework.RegisterCommonFlags(flag.CommandLine)
framework.RegisterClusterFlags(flag.CommandLine)
flag.Parse()
}

func TestMain(m *testing.M) {
var versionFlag bool
flag.CommandLine.BoolVar(&versionFlag, "version", false, "Displays version information.")

// Register test flags, then parse flags.
handleFlags()
HandleFlags()

if framework.TestContext.ListImages {
for _, v := range image.GetImageConfigs() {
Expand Down
15 changes: 15 additions & 0 deletions test/e2e/patch_e2e.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package e2e

import (
"flag"

"k8s.io/kubernetes/test/e2e/framework"
"k8s.io/kubernetes/test/e2e/framework/config"
)

func HandleFlags() {
config.CopyFlags(config.Flags, flag.CommandLine)
framework.RegisterCommonFlags(flag.CommandLine)
framework.RegisterClusterFlags(flag.CommandLine)
flag.Parse()
}

0 comments on commit 332abdd

Please sign in to comment.