mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #81488 from oomichi/move-HandleFlags
Move HandleFlags to e2e package
This commit is contained in:
commit
09a4b7e257
@ -20,6 +20,7 @@ go_test(
|
|||||||
"//test/e2e/cloud:go_default_library",
|
"//test/e2e/cloud:go_default_library",
|
||||||
"//test/e2e/common:go_default_library",
|
"//test/e2e/common:go_default_library",
|
||||||
"//test/e2e/framework:go_default_library",
|
"//test/e2e/framework:go_default_library",
|
||||||
|
"//test/e2e/framework/config:go_default_library",
|
||||||
"//test/e2e/framework/testfiles:go_default_library",
|
"//test/e2e/framework/testfiles:go_default_library",
|
||||||
"//test/e2e/framework/viperconfig:go_default_library",
|
"//test/e2e/framework/viperconfig:go_default_library",
|
||||||
"//test/e2e/generated:go_default_library",
|
"//test/e2e/generated:go_default_library",
|
||||||
|
@ -31,6 +31,7 @@ import (
|
|||||||
// "github.com/onsi/ginkgo"
|
// "github.com/onsi/ginkgo"
|
||||||
|
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
|
"k8s.io/kubernetes/test/e2e/framework/config"
|
||||||
"k8s.io/kubernetes/test/e2e/framework/testfiles"
|
"k8s.io/kubernetes/test/e2e/framework/testfiles"
|
||||||
"k8s.io/kubernetes/test/e2e/framework/viperconfig"
|
"k8s.io/kubernetes/test/e2e/framework/viperconfig"
|
||||||
"k8s.io/kubernetes/test/e2e/generated"
|
"k8s.io/kubernetes/test/e2e/generated"
|
||||||
@ -60,9 +61,17 @@ import (
|
|||||||
|
|
||||||
var viperConfig = flag.String("viper-config", "", "The name of a viper config file (https://github.com/spf13/viper#what-is-viper). All e2e command line parameters can also be configured in such a file. May contain a path and may or may not contain the file suffix. The default is to look for an optional file with `e2e` as base name. If a file is specified explicitly, it must be present.")
|
var viperConfig = flag.String("viper-config", "", "The name of a viper config file (https://github.com/spf13/viper#what-is-viper). All e2e command line parameters can also be configured in such a file. May contain a path and may or may not contain the file suffix. The default is to look for an optional file with `e2e` as base name. If a file is specified explicitly, it must be present.")
|
||||||
|
|
||||||
|
// 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 init() {
|
func init() {
|
||||||
// Register framework and test flags, then parse flags.
|
// Register test flags, then parse flags.
|
||||||
framework.HandleFlags()
|
handleFlags()
|
||||||
|
|
||||||
// Now that we know which Viper config (if any) was chosen,
|
// Now that we know which Viper config (if any) was chosen,
|
||||||
// parse it and update those options which weren't already set via command line flags
|
// parse it and update those options which weren't already set via command line flags
|
||||||
|
@ -85,7 +85,6 @@ go_library(
|
|||||||
"//staging/src/k8s.io/client-go/tools/remotecommand:go_default_library",
|
"//staging/src/k8s.io/client-go/tools/remotecommand:go_default_library",
|
||||||
"//staging/src/k8s.io/client-go/tools/watch:go_default_library",
|
"//staging/src/k8s.io/client-go/tools/watch:go_default_library",
|
||||||
"//staging/src/k8s.io/component-base/cli/flag:go_default_library",
|
"//staging/src/k8s.io/component-base/cli/flag:go_default_library",
|
||||||
"//test/e2e/framework/config:go_default_library",
|
|
||||||
"//test/e2e/framework/ginkgowrapper:go_default_library",
|
"//test/e2e/framework/ginkgowrapper:go_default_library",
|
||||||
"//test/e2e/framework/kubelet:go_default_library",
|
"//test/e2e/framework/kubelet:go_default_library",
|
||||||
"//test/e2e/framework/log:go_default_library",
|
"//test/e2e/framework/log:go_default_library",
|
||||||
|
@ -33,7 +33,6 @@ import (
|
|||||||
cliflag "k8s.io/component-base/cli/flag"
|
cliflag "k8s.io/component-base/cli/flag"
|
||||||
"k8s.io/klog"
|
"k8s.io/klog"
|
||||||
kubeletconfig "k8s.io/kubernetes/pkg/kubelet/apis/config"
|
kubeletconfig "k8s.io/kubernetes/pkg/kubelet/apis/config"
|
||||||
e2econfig "k8s.io/kubernetes/test/e2e/framework/config"
|
|
||||||
e2elog "k8s.io/kubernetes/test/e2e/framework/log"
|
e2elog "k8s.io/kubernetes/test/e2e/framework/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -363,14 +362,6 @@ func RegisterNodeFlags(flags *flag.FlagSet) {
|
|||||||
flags.Var(cliflag.NewMapStringString(&TestContext.ExtraEnvs), "extra-envs", "The extra environment variables needed for node e2e tests. Format: a list of key=value pairs, e.g., env1=val1,env2=val2")
|
flags.Var(cliflag.NewMapStringString(&TestContext.ExtraEnvs), "extra-envs", "The extra environment variables needed for node e2e tests. Format: a list of key=value pairs, e.g., env1=val1,env2=val2")
|
||||||
}
|
}
|
||||||
|
|
||||||
// HandleFlags sets up all flags and parses the command line.
|
|
||||||
func HandleFlags() {
|
|
||||||
e2econfig.CopyFlags(e2econfig.Flags, flag.CommandLine)
|
|
||||||
RegisterCommonFlags(flag.CommandLine)
|
|
||||||
RegisterClusterFlags(flag.CommandLine)
|
|
||||||
flag.Parse()
|
|
||||||
}
|
|
||||||
|
|
||||||
func createKubeConfig(clientCfg *restclient.Config) *clientcmdapi.Config {
|
func createKubeConfig(clientCfg *restclient.Config) *clientcmdapi.Config {
|
||||||
clusterNick := "cluster"
|
clusterNick := "cluster"
|
||||||
userNick := "user"
|
userNick := "user"
|
||||||
|
Loading…
Reference in New Issue
Block a user