Fix tests using kubectl convert

hack/make-rules/test-cmd.sh script fails with tariling errors.

Error: unknown command "convert" for "kubectl"

1. This PR fixes the errors by replacing or removing the use of
"kubectl convert" option because it was already removed.

2. Fix trailing shell check failure as well.
In ./test/cmd/generic-resources.sh line 366:
  kube::test::get_object_assert deployment "{{range.items}}{{$image_field0}}:{{end}}" "${IMAGE_NGINX}:${IMAGE_NGINX}:"
This commit is contained in:
Masashi Honma
2021-02-18 08:24:07 +09:00
parent b2860a3604
commit e8c038c96d
3 changed files with 3 additions and 33 deletions

View File

@@ -85,7 +85,7 @@ run_kubectl_create_error_tests() {
rm "${ERROR_FILE}"
# Posting a pod to namespaces should fail. Also tests --raw forcing the post location
grep -q "cannot be handled as a Namespace: converting (v1.Pod)" <<< "$( 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 -q 'the object provided is unrecognized (must be of type Namespace)' <<< "$( kubectl create "${kube_flags[@]}" --raw /api/v1/namespaces -f test/fixtures/doc-yaml/admin/limitrange/valid-pod.yaml --v=8 2>&1 )"
grep -q "raw and --edit are mutually exclusive" <<< "$( kubectl create "${kube_flags[@]}" --raw /api/v1/namespaces -f test/fixtures/doc-yaml/admin/limitrange/valid-pod.yaml --edit 2>&1 )"