GKE: Limit liveness.sh to server version >0.7.2

What I really want is
https://github.com/GoogleCloudPlatform/kubernetes/issues/2953, but
haven't had a chance to code that yet. Maybe it's time. (Then I'd
remove the provider-specific test and just say "is it > 0.7.2, or does
it claim to be capable of something from the future?" The latter
covers the HEAD server case .. though just bumping the server version
immediately after release might also accomplish that, too.)
This commit is contained in:
Zach Loafman
2014-12-24 07:49:10 -08:00
parent 4e417b98b5
commit e965fc1f79
2 changed files with 33 additions and 3 deletions

View File

@@ -25,10 +25,20 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
source "${KUBE_ROOT}/cluster/kube-env.sh"
source "${KUBE_ROOT}/cluster/$KUBERNETES_PROVIDER/util.sh"
liveness_tests="http exec"
if [[ ${KUBERNETES_PROVIDER} == "gke" ]]; then
server_version=$(kube_server_version)
if [[ ${server_version} -le 702 ]]; then
echo "GKE server version <= 0.7.2, limiting test to http (version = ${server_version})"
liveness_tests="http"
fi
fi
function teardown() {
echo "Cleaning up test artifacts"
${KUBECFG} delete pods/liveness-http
${KUBECFG} delete pods/liveness-exec
for test in ${liveness_tests}; do
${KUBECFG} delete pods/liveness-${test}
done
}
function waitForNotPending() {
@@ -58,7 +68,7 @@ function waitForNotPending() {
trap "teardown" EXIT
for test in http exec; do
for test in ${liveness_tests}; do
echo "Liveness test: ${test}"
${KUBECFG} -c ${KUBE_ROOT}/examples/liveness/${test}-liveness.yaml create pods
waitForNotPending