mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-09 21:21:14 +00:00
add kubectl create --raw -f
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user