Adding a SSH tunnel check to GKE upgrades

This commit is contained in:
Kris 2017-03-29 11:37:29 -07:00
parent c25c186ec5
commit f6c1993b84

View File

@ -87,7 +87,13 @@ func masterUpgradeGKE(v string) error {
"--master",
fmt.Sprintf("--cluster-version=%s", v),
"--quiet")
return err
if err != nil {
return err
}
waitForSSHTunnels()
return nil
}
func NodeUpgrade(f *Framework, v string, img string) error {
@ -166,7 +172,14 @@ func nodeUpgradeGKE(v string, img string) error {
args = append(args, fmt.Sprintf("--image-type=%s", img))
}
_, _, err := RunCmd("gcloud", args...)
return err
if err != nil {
return err
}
waitForSSHTunnels()
return nil
}
// CheckNodesReady waits up to nt for expect nodes accessed by c to be ready,
@ -270,3 +283,19 @@ func gceUpgradeScript() string {
}
return TestContext.GCEUpgradeScript
}
func waitForSSHTunnels() {
Logf("Waiting for SSH tunnels to establish")
RunKubectl("run", "ssh-tunnel-test",
"--image=gcr.io/google_containers/busybox:1.24",
"--restart=Never",
"--command", "--",
"echo", "Hello")
defer RunKubectl("delete", "pod", "ssh-tunnel-test")
// allow up to a minute for new ssh tunnels to establish
wait.PollImmediate(5*time.Second, time.Minute, func() (bool, error) {
_, err := RunKubectl("logs", "ssh-tunnel-test")
return err == nil, nil
})
}