kubectl: add --support to get, patch, edit and replace commands

Co-authored-by: Nikhita Raghunath <nikitaraghunath@gmail.com>
This commit is contained in:
Yuvaraj Kakaraparthi
2021-07-07 08:30:59 -07:00
committed by Nikhita Raghunath
parent f97825e1ce
commit a5aa858d44
25 changed files with 775 additions and 36 deletions

View File

@@ -175,6 +175,14 @@ run_kubectl_get_tests() {
output_message=$(! kubectl get pod valid-pod --allow-missing-template-keys=false -o go-template='{{.missing}}' "${kube_flags[@]}")
kube::test::if_has_string "${output_message}" 'map has no entry for key "missing"'
## check --subresource=status works
output_message=$(kubectl get "${kube_flags[@]}" pod valid-pod --subresource=status)
kube::test::if_has_string "${output_message}" 'valid-pod'
## check --subresource=scale returns an error for pods
output_message=$(! kubectl get pod valid-pod --subresource=scale 2>&1 "${kube_flags[@]:?}")
kube::test::if_has_string "${output_message}" 'the server could not find the requested resource'
### Test kubectl get watch
output_message=$(kubectl get pods -w --request-timeout=1 "${kube_flags[@]}")
kube::test::if_has_string "${output_message}" 'STATUS' # headers