mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-06 03:33:26 +00:00
List output with differing types should be more resilient
kubectl get can output a series of objects as a List in versioned form, but not all API objects are available in the same schema. Make the act of converting a []runtime.Object to api.List more robust and add a test to verify its behavior in Get. Makes it easier for client code to output unified objects.
This commit is contained in:
@@ -162,6 +162,7 @@ for version in "${kube_api_versions[@]}"; do
|
||||
# Command
|
||||
kubectl create "${kube_flags[@]}" -f examples/limitrange/valid-pod.json
|
||||
# Post-condition: valid-pod POD is running
|
||||
kubectl get "${kube_flags[@]}" pods -o json
|
||||
kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:'
|
||||
kube::test::get_object_assert 'pod valid-pod' "{{$id_field}}" 'valid-pod'
|
||||
kube::test::get_object_assert 'pod/valid-pod' "{{$id_field}}" 'valid-pod'
|
||||
|
Reference in New Issue
Block a user