Fix panic when sort-by is used with kubectl get.

This commit is contained in:
Avesh Agarwal
2016-01-13 12:11:46 -05:00
parent 23b4bfb370
commit bec2d678b9
2 changed files with 11 additions and 1 deletions

View File

@@ -1341,6 +1341,16 @@ __EOF__
[[ "$(grep "Watch for changes to the described resources" "${file}")" ]]
fi
#####################
# Kubectl --sort-by #
#####################
### sort-by should not panic if no pod exists
# Pre-condition: no POD exists
kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" ''
# Command
kubectl get pods --sort-by="{metadata.name}"
kube::test::clear_all
}