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

@@ -49,7 +49,7 @@ declare -a resources=(
)
# Find all the namespaces.
namespaces=( $("${KUBECTL}" get namespaces -o template -t "{{range.items}}{{.metadata.name}} {{end}}"))
namespaces=( $("${KUBECTL}" get namespaces -o go-template="{{range.items}}{{.metadata.name}} {{end}}"))
if [ -z "${namespaces:-}" ]
then
echo "Unexpected: No namespace found. Nothing to do."
@@ -59,7 +59,7 @@ for resource in "${resources[@]}"
do
for namespace in "${namespaces[@]}"
do
instances=( $("${KUBECTL}" get "${resource}" --namespace="${namespace}" -o template -t "{{range.items}}{{.metadata.name}} {{end}}"))
instances=( $("${KUBECTL}" get "${resource}" --namespace="${namespace}" -o go-template="{{range.items}}{{.metadata.name}} {{end}}"))
# Nothing to do if there is no instance of that resource.
if [[ -z "${instances:-}" ]]
then