mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-27 21:26:03 +00:00
Fix panic when sort-by is used with kubectl get.
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user