mirror of https://github.com/k3s-io/k3s
Fix bug printing openapi columns
parent
44073e6f43
commit
613b302b98
|
@ -1392,6 +1392,12 @@ run_kubectl_old_print_tests() {
|
||||||
actual_output=$(kubectl get pod --server-print=false "${kube_flags[@]}" | awk 'NF{NF--};1')
|
actual_output=$(kubectl get pod --server-print=false "${kube_flags[@]}" | awk 'NF{NF--};1')
|
||||||
kube::test::if_has_string "${actual_output}" "${expected_output}"
|
kube::test::if_has_string "${actual_output}" "${expected_output}"
|
||||||
|
|
||||||
|
# Test printing objects with --use-openapi-print-columns
|
||||||
|
actual_output=$(kubectl get namespaces --use-openapi-print-columns --v=7 "${kube_flags[@]}" 2>&1)
|
||||||
|
# it should request full objects (not server-side printing)
|
||||||
|
kube::test::if_has_not_string "${actual_output}" 'application/json;as=Table'
|
||||||
|
kube::test::if_has_string "${actual_output}" 'application/json'
|
||||||
|
|
||||||
### Test retrieval of daemonsets against server-side printing
|
### Test retrieval of daemonsets against server-side printing
|
||||||
kubectl apply -f hack/testdata/rollingupdate-daemonset.yaml "${kube_flags[@]}"
|
kubectl apply -f hack/testdata/rollingupdate-daemonset.yaml "${kube_flags[@]}"
|
||||||
# Post-condition: daemonset is created
|
# Post-condition: daemonset is created
|
||||||
|
|
|
@ -318,6 +318,10 @@ func (o *GetOptions) Run(f cmdutil.Factory, cmd *cobra.Command, args []string) e
|
||||||
Latest().
|
Latest().
|
||||||
Flatten().
|
Flatten().
|
||||||
TransformRequests(func(req *rest.Request) {
|
TransformRequests(func(req *rest.Request) {
|
||||||
|
// We need full objects if printing with openapi columns
|
||||||
|
if o.PrintWithOpenAPICols {
|
||||||
|
return
|
||||||
|
}
|
||||||
if o.ServerPrint && o.IsHumanReadablePrinter && !o.Sort {
|
if o.ServerPrint && o.IsHumanReadablePrinter && !o.Sort {
|
||||||
group := metav1beta1.GroupName
|
group := metav1beta1.GroupName
|
||||||
version := metav1beta1.SchemeGroupVersion.Version
|
version := metav1beta1.SchemeGroupVersion.Version
|
||||||
|
|
Loading…
Reference in New Issue