Skip to content

Commit 886c58c

Browse files
soltyshbertinatto
authored andcommitted
UPSTREAM: <carry>: export HandleFlags
OpenShift-Rebase-Source: 7bf2f1f
1 parent 04eef62 commit 886c58c

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

test/e2e/e2e_test.go

+1-10
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import (
3636
"k8s.io/klog/v2"
3737
conformancetestdata "k8s.io/kubernetes/test/conformance/testdata"
3838
"k8s.io/kubernetes/test/e2e/framework"
39-
"k8s.io/kubernetes/test/e2e/framework/config"
4039
"k8s.io/kubernetes/test/e2e/framework/testfiles"
4140
e2etestingmanifests "k8s.io/kubernetes/test/e2e/testing-manifests"
4241
testfixtures "k8s.io/kubernetes/test/fixtures"
@@ -73,21 +72,13 @@ import (
7372
_ "k8s.io/kubernetes/test/utils/format"
7473
)
7574

76-
// handleFlags sets up all flags and parses the command line.
77-
func handleFlags() {
78-
config.CopyFlags(config.Flags, flag.CommandLine)
79-
framework.RegisterCommonFlags(flag.CommandLine)
80-
framework.RegisterClusterFlags(flag.CommandLine)
81-
flag.Parse()
82-
}
83-
8475
func TestMain(m *testing.M) {
8576
var versionFlag bool
8677
flag.CommandLine.BoolVar(&versionFlag, "version", false, "Displays version information.")
8778
listConformanceTests := flag.CommandLine.Bool("list-conformance-tests", false, "If true, will show list of conformance tests.")
8879

8980
// Register test flags, then parse flags.
90-
handleFlags()
81+
HandleFlags()
9182

9283
if versionFlag {
9384
fmt.Printf("%s\n", version.Get())

test/e2e/patch_e2e.go

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package e2e
2+
3+
import (
4+
"flag"
5+
6+
"k8s.io/kubernetes/test/e2e/framework"
7+
"k8s.io/kubernetes/test/e2e/framework/config"
8+
)
9+
10+
func HandleFlags() {
11+
config.CopyFlags(config.Flags, flag.CommandLine)
12+
framework.RegisterCommonFlags(flag.CommandLine)
13+
framework.RegisterClusterFlags(flag.CommandLine)
14+
flag.Parse()
15+
}

0 commit comments

Comments
 (0)