type RESTMapper errors to better handle MultiRESTMapper errors

This commit is contained in:
deads2k
2016-02-08 10:41:31 -05:00
parent 62e574341c
commit deb4d3ccca
8 changed files with 526 additions and 111 deletions

View File

@@ -282,6 +282,27 @@ runTests() {
fi
stop-proxy
#########################
# RESTMapper evaluation #
#########################
kube::log::status "Testing RESTMapper"
RESTMAPPER_ERROR_FILE="${KUBE_TEMP}/restmapper-error"
### Non-existent resource type should give a recognizeable error
# Pre-condition: None
# Command
kubectl get "${kube_flags[@]}" unknownresourcetype 2>${RESTMAPPER_ERROR_FILE} || true
if grep -q "the server doesn't have a resource type" "${RESTMAPPER_ERROR_FILE}"; then
kube::log::status "\"kubectl get unknownresourcetype\" returns error as expected: $(cat ${RESTMAPPER_ERROR_FILE})"
else
kube::log::status "\"kubectl get unknownresourcetype\" returns unexpected error or non-error: $(cat ${RESTMAPPER_ERROR_FILE})"
exit 1
fi
rm "${RESTMAPPER_ERROR_FILE}"
# Post-condition: None
###########################
# POD creation / deletion #
###########################