Merge pull request #33847 from deads2k/test-annoyance

Automatic merge from submit-queue

add optional env var for allowing version skew in test cmd

If you only make a change to a server component and then re-run `test-cmd` you get a skew error.  This is really annoying.  I've left the default as it was (force version match), but now also allow `ALLOW_SKEW=true hack/test-cmd.sh` to skip the check.

@eparis worth a quick bash check, but I think I got it.
This commit is contained in:
Kubernetes Submit Queue
2016-09-30 19:55:07 -07:00
committed by GitHub

View File

@@ -304,14 +304,18 @@ runTests() {
if [[ -z "${version}" ]]; then
kube_flags=(
-s "http://127.0.0.1:${API_PORT}"
--match-server-version
)
if [[ -z "${ALLOW_SKEW:-}" ]]; then
kube_flags+=("--match-server-version")
fi
[ "$(kubectl get nodes -o go-template='{{ .apiVersion }}' "${kube_flags[@]}")" == "v1" ]
else
kube_flags=(
-s "http://127.0.0.1:${API_PORT}"
--match-server-version
)
if [[ -z "${ALLOW_SKEW:-}" ]]; then
kube_flags+=("--match-server-version")
fi
[ "$(kubectl get nodes -o go-template='{{ .apiVersion }}' "${kube_flags[@]}")" == "${version}" ]
fi
id_field=".metadata.name"