change -o template to -o go-template=...

This commit is contained in:
Dai Zuozhuo
2015-08-21 21:09:41 +08:00
parent 9ccceac5e8
commit 2e2ef3e830
30 changed files with 124 additions and 74 deletions

View File

@@ -31,7 +31,7 @@ kube::test::get_object_assert() {
local request=$2
local expected=$3
res=$(eval kubectl get "${kube_flags[@]}" $object -o template -t \"$request\")
res=$(eval kubectl get "${kube_flags[@]}" $object -o go-template=\"$request\")
if [[ "$res" =~ ^$expected$ ]]; then
echo -n ${green}
@@ -56,7 +56,7 @@ kube::test::get_object_jsonpath_assert() {
local request=$2
local expected=$3
res=$(eval kubectl get "${kube_flags[@]}" $object -o jsonpath -t \"$request\")
res=$(eval kubectl get "${kube_flags[@]}" $object -o jsonpath=\"$request\")
if [[ "$res" =~ ^$expected$ ]]; then
echo -n ${green}

View File

@@ -163,14 +163,14 @@ runTests() {
-s "http://127.0.0.1:${API_PORT}"
--match-server-version
)
[ "$(kubectl get nodes -t '{{ .apiVersion }}' "${kube_flags[@]}")" == "v1" ]
[ "$(kubectl get nodes -o go-template='{{ .apiVersion }}' "${kube_flags[@]}")" == "v1" ]
else
kube_flags=(
-s "http://127.0.0.1:${API_PORT}"
--match-server-version
--api-version="${version}"
)
[ "$(kubectl get nodes -t '{{ .apiVersion }}' "${kube_flags[@]}")" == "${version}" ]
[ "$(kubectl get nodes -o go-template='{{ .apiVersion }}' "${kube_flags[@]}")" == "${version}" ]
fi
id_field=".metadata.name"
labels_field=".metadata.labels"