add kubectl create --raw -f

This commit is contained in:
David Eads
2017-10-19 11:00:50 -04:00
parent 060b4b8b84
commit 58f39a15de
3 changed files with 69 additions and 4 deletions

View File

@@ -936,6 +936,9 @@ run_create_tests() {
# Post-condition: jsonpath for .metadata.namespace should be empty for object since --namespace was not explicitly specified
kube::test::if_empty_string "${output_message}"
kubectl create configmap tester-create-cm -o json --dry-run | kubectl create "${kube_flags[@]}" --raw /api/v1/namespaces/default/configmaps -f -
kubectl delete -ndefault "${kube_flags[@]}" configmap tester-create-cm
set +o nounset
set +o errexit
}
@@ -3674,6 +3677,11 @@ run_kubectl_create_error_tests() {
fi
rm "${ERROR_FILE}"
# Posting a pod to namespaces should fail. Also tests --raw forcing the post location
[ "$( kubectl convert -f test/fixtures/doc-yaml/admin/limitrange/valid-pod.yaml -o json | kubectl create "${kube_flags[@]}" --raw /api/v1/namespaces -f - --v=8 2>&1 | grep 'cannot be handled as a Namespace: converting (v1.Pod)')" ]
[ "$( kubectl create "${kube_flags[@]}" --raw /api/v1/namespaces -f test/fixtures/doc-yaml/admin/limitrange/valid-pod.yaml --edit 2>&1 | grep 'raw and --edit are mutually exclusive')" ]
set +o nounset
set +o errexit
}