Skip to content

Commit

Permalink
UPSTREAM: <carry>: export HandleFlags
Browse files Browse the repository at this point in the history
OpenShift-Rebase-Source: 7bf2f1f
  • Loading branch information
soltysh authored and bertinatto committed Mar 6, 2024
1 parent 52f6418 commit a9c541e
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 Down Expand Up @@ -75,21 +74,13 @@ import (
_ "k8s.io/kubernetes/test/utils/format"
)

// 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.")
listConformanceTests := flag.CommandLine.Bool("list-conformance-tests", false, "If true, will show list of conformance tests.")

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

if versionFlag {
fmt.Printf("%s\n", version.Get())
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 a9c541e

Please sign in to comment.