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:
@@ -304,14 +304,18 @@ runTests() {
|
|||||||
if [[ -z "${version}" ]]; then
|
if [[ -z "${version}" ]]; then
|
||||||
kube_flags=(
|
kube_flags=(
|
||||||
-s "http://127.0.0.1:${API_PORT}"
|
-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" ]
|
[ "$(kubectl get nodes -o go-template='{{ .apiVersion }}' "${kube_flags[@]}")" == "v1" ]
|
||||||
else
|
else
|
||||||
kube_flags=(
|
kube_flags=(
|
||||||
-s "http://127.0.0.1:${API_PORT}"
|
-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}" ]
|
[ "$(kubectl get nodes -o go-template='{{ .apiVersion }}' "${kube_flags[@]}")" == "${version}" ]
|
||||||
fi
|
fi
|
||||||
id_field=".metadata.name"
|
id_field=".metadata.name"
|
||||||
|
|||||||
Reference in New Issue
Block a user