mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-13 05:46:16 +00:00
Merge pull request #3488 from pmorie/e2e
Make e2e -up recreate running clusters; remove kube-up retry
This commit is contained in:
commit
fbd4722094
23
hack/e2e.go
23
hack/e2e.go
@ -180,17 +180,20 @@ func main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TearDown() {
|
func TearDown() bool {
|
||||||
runBash("teardown", "test-teardown")
|
return runBash("teardown", "test-teardown")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Up brings an e2e cluster up, recreating it if one is already running.
|
||||||
func Up() bool {
|
func Up() bool {
|
||||||
if !tryUp() {
|
if IsUp() {
|
||||||
log.Printf("kube-up failed; will tear down and retry. (Possibly your cluster was in some partially created state?)")
|
log.Printf("e2e cluster already running; will teardown")
|
||||||
TearDown()
|
if res := TearDown(); !res {
|
||||||
return tryUp()
|
return false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true
|
|
||||||
|
return runBash("up", path.Join(versionRoot, "/cluster/kube-up.sh; test-setup;"))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Is the e2e cluster up?
|
// Is the e2e cluster up?
|
||||||
@ -198,10 +201,6 @@ func IsUp() bool {
|
|||||||
return runBash("get status", `$KUBECTL version`)
|
return runBash("get status", `$KUBECTL version`)
|
||||||
}
|
}
|
||||||
|
|
||||||
func tryUp() bool {
|
|
||||||
return runBash("up", path.Join(versionRoot, "/cluster/kube-up.sh; test-setup;"))
|
|
||||||
}
|
|
||||||
|
|
||||||
// PrepareVersion makes sure that the specified release version is locally
|
// PrepareVersion makes sure that the specified release version is locally
|
||||||
// available and ready to be used by kube-up or kube-push. Returns the director
|
// available and ready to be used by kube-up or kube-push. Returns the director
|
||||||
// path of the release.
|
// path of the release.
|
||||||
@ -545,7 +544,7 @@ set -o pipefail
|
|||||||
export KUBE_CONFIG_FILE="config-test.sh"
|
export KUBE_CONFIG_FILE="config-test.sh"
|
||||||
|
|
||||||
# TODO(jbeda): This will break on usage if there is a space in
|
# TODO(jbeda): This will break on usage if there is a space in
|
||||||
# ${KUBE_ROOT}. Covert to an array? Or an exported function?
|
# ${KUBE_ROOT}. Convert to an array? Or an exported function?
|
||||||
export KUBECFG="` + versionRoot + `/cluster/kubecfg.sh` + kubecfgArgs() + `"
|
export KUBECFG="` + versionRoot + `/cluster/kubecfg.sh` + kubecfgArgs() + `"
|
||||||
export KUBECTL="` + versionRoot + `/cluster/kubectl.sh` + kubectlArgs() + `"
|
export KUBECTL="` + versionRoot + `/cluster/kubectl.sh` + kubectlArgs() + `"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user