alpine-overlay/kubezero/kubernetes/make-test-cmd-run-over-hyperkube-based-kubectl.patch

20 lines
766 B
Diff
Raw Normal View History

2021-11-12 17:28:59 +00:00
diff --git a/hack/lib/test.sh b/hack/lib/test.sh
2023-07-04 15:10:30 +00:00
index 36ea5f04..045de151 100644
2021-11-12 17:28:59 +00:00
--- a/hack/lib/test.sh
+++ b/hack/lib/test.sh
2023-07-04 15:10:30 +00:00
@@ -78,12 +78,12 @@ kube::test::object_assert() {
2021-11-12 17:28:59 +00:00
local object=$2
local request=$3
local expected=$4
- local args=${5:-}
+ local get_args=${5:-}
for j in $(seq 1 "${tries}"); do
# shellcheck disable=SC2086
2023-07-04 15:10:30 +00:00
# Disabling because to allow for expansion here
- res=$(kubectl get "${kube_flags[@]}" ${args} ${object} -o go-template="${request}")
+ res=$(eval kubectl ${args} get "${kube_flags[@]}" ${get_args} "${object}" -o go-template=\""${request}"\")
2021-11-12 17:28:59 +00:00
if [[ "${res}" =~ ^$expected$ ]]; then
echo -n "${green}"
echo "$(kube::test::get_caller 3): Successful get ${object} ${request}: ${res}"