mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 16:29:21 +00:00
Merge pull request #97028 from knabben/e2e-restart-kubelet
Adding restart kubelet flag on e2e test
This commit is contained in:
commit
af60bebde3
@ -229,6 +229,8 @@ type NodeTestContextType struct {
|
|||||||
// the node e2e test. If empty, the default one (system.DefaultSpec) is
|
// the node e2e test. If empty, the default one (system.DefaultSpec) is
|
||||||
// used. The system specs are in test/e2e_node/system/specs/.
|
// used. The system specs are in test/e2e_node/system/specs/.
|
||||||
SystemSpecName string
|
SystemSpecName string
|
||||||
|
// RestartKubelet restarts Kubelet unit when the process is killed.
|
||||||
|
RestartKubelet bool
|
||||||
// ExtraEnvs is a map of environment names to values.
|
// ExtraEnvs is a map of environment names to values.
|
||||||
ExtraEnvs map[string]string
|
ExtraEnvs map[string]string
|
||||||
}
|
}
|
||||||
|
@ -80,6 +80,7 @@ func registerNodeFlags(flags *flag.FlagSet) {
|
|||||||
// It is hard and unnecessary to deal with the complexity inside the test suite.
|
// It is hard and unnecessary to deal with the complexity inside the test suite.
|
||||||
flags.BoolVar(&framework.TestContext.NodeConformance, "conformance", false, "If true, the test suite will not start kubelet, and fetch system log (kernel, docker, kubelet log etc.) to the report directory.")
|
flags.BoolVar(&framework.TestContext.NodeConformance, "conformance", false, "If true, the test suite will not start kubelet, and fetch system log (kernel, docker, kubelet log etc.) to the report directory.")
|
||||||
flags.BoolVar(&framework.TestContext.PrepullImages, "prepull-images", true, "If true, prepull images so image pull failures do not cause test failures.")
|
flags.BoolVar(&framework.TestContext.PrepullImages, "prepull-images", true, "If true, prepull images so image pull failures do not cause test failures.")
|
||||||
|
flags.BoolVar(&framework.TestContext.RestartKubelet, "restart-kubelet", true, "If true, restart Kubelet unit when the process is killed.")
|
||||||
flags.StringVar(&framework.TestContext.ImageDescription, "image-description", "", "The description of the image which the test will be running on.")
|
flags.StringVar(&framework.TestContext.ImageDescription, "image-description", "", "The description of the image which the test will be running on.")
|
||||||
flags.StringVar(&framework.TestContext.SystemSpecName, "system-spec-name", "", "The name of the system spec (e.g., gke) that's used in the node e2e test. The system specs are in test/e2e_node/system/specs/. This is used by the test framework to determine which tests to run for validating the system requirements.")
|
flags.StringVar(&framework.TestContext.SystemSpecName, "system-spec-name", "", "The name of the system spec (e.g., gke) that's used in the node e2e test. The system specs are in test/e2e_node/system/specs/. This is used by the test framework to determine which tests to run for validating the system requirements.")
|
||||||
flags.Var(cliflag.NewMapStringString(&framework.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(&framework.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")
|
||||||
|
@ -301,6 +301,7 @@ func (e *E2EServices) startKubelet() (*server, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cmd := exec.Command(cmdArgs[0], cmdArgs[1:]...)
|
cmd := exec.Command(cmdArgs[0], cmdArgs[1:]...)
|
||||||
|
restartOnExit := framework.TestContext.RestartKubelet
|
||||||
server := newServer(
|
server := newServer(
|
||||||
"kubelet",
|
"kubelet",
|
||||||
cmd,
|
cmd,
|
||||||
@ -309,7 +310,7 @@ func (e *E2EServices) startKubelet() (*server, error) {
|
|||||||
[]string{kubeletHealthCheckURL},
|
[]string{kubeletHealthCheckURL},
|
||||||
"kubelet.log",
|
"kubelet.log",
|
||||||
e.monitorParent,
|
e.monitorParent,
|
||||||
true /* restartOnExit */)
|
restartOnExit)
|
||||||
return server, server.start()
|
return server, server.start()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user