mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 22:46:12 +00:00
Fixes to e2e script
This commit is contained in:
parent
02bfcd6b6d
commit
47f1cb966b
21
hack/e2e.go
21
hack/e2e.go
@ -31,11 +31,13 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
isup = flag.Bool("isup", false, "Check to see if the e2e cluster is up, then exit.")
|
||||||
build = flag.Bool("build", false, "If true, build a new release. Otherwise, use whatever is there.")
|
build = flag.Bool("build", false, "If true, build a new release. Otherwise, use whatever is there.")
|
||||||
up = flag.Bool("up", false, "If true, start the the e2e cluster. If cluster is already up, recreate it.")
|
up = flag.Bool("up", false, "If true, start the the e2e cluster. If cluster is already up, recreate it.")
|
||||||
push = flag.Bool("push", false, "If true, push to e2e cluster. Has no effect if -up is true.")
|
push = flag.Bool("push", false, "If true, push to e2e cluster. Has no effect if -up is true.")
|
||||||
down = flag.Bool("down", false, "If true, tear down the cluster before exiting.")
|
down = flag.Bool("down", false, "If true, tear down the cluster before exiting.")
|
||||||
tests = flag.String("tests", "*", "Run tests in hack/e2e-suite matching this glob.")
|
test = flag.Bool("test", false, "Run all tests in hack/e2e-suite.")
|
||||||
|
tests = flag.String("tests", "", "Run only tests in hack/e2e-suite matching this glob. Ignored if -test is set.")
|
||||||
root = flag.String("root", absOrDie(filepath.Clean(filepath.Join(path.Base(os.Args[0]), ".."))), "Root directory of kubernetes repository.")
|
root = flag.String("root", absOrDie(filepath.Clean(filepath.Join(path.Base(os.Args[0]), ".."))), "Root directory of kubernetes repository.")
|
||||||
verbose = flag.Bool("v", false, "If true, print all command output.")
|
verbose = flag.Bool("v", false, "If true, print all command output.")
|
||||||
)
|
)
|
||||||
@ -54,8 +56,23 @@ func main() {
|
|||||||
flag.Parse()
|
flag.Parse()
|
||||||
signal.Notify(signals, os.Interrupt)
|
signal.Notify(signals, os.Interrupt)
|
||||||
|
|
||||||
|
if *test {
|
||||||
|
*tests = "*"
|
||||||
|
}
|
||||||
|
|
||||||
|
if *isup {
|
||||||
|
status := 1
|
||||||
|
if runBash("get status", `$KUBECFG -server_version`) {
|
||||||
|
status = 0
|
||||||
|
log.Printf("Cluster is UP")
|
||||||
|
} else {
|
||||||
|
log.Printf("Cluster is DOWN")
|
||||||
|
}
|
||||||
|
os.Exit(status)
|
||||||
|
}
|
||||||
|
|
||||||
if *build {
|
if *build {
|
||||||
if runBash("build", `test-build-release`) {
|
if !runBash("build", `test-build-release`) {
|
||||||
log.Fatal("Error building. Aborting.")
|
log.Fatal("Error building. Aborting.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user