kubectl: additionalPrinterColumns for CRD's doesn't work in k8s 1.11 for columns with array data
Kubernetes version (use kubectl version
): 1.11 (server-side printing)
Environment:
- Cloud provider or hardware configuration: GKE
Bug Reproduce using the following steps:
- Create CRD:
crd.yaml
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: foos.example.istio.io
spec:
group: example.istio.io
names:
kind: Foo
listKind: FooList
plural: foos
singular: foo
scope: Namespaced
version: v1alpha1
additionalPrinterColumns:
- JSONPath: .spec.servers[*].hosts
name: hosts
type: string
$ kubectl apply -f crd.yaml
- Create an instance of the CRD:
crd-instance.yaml
apiVersion: example.istio.io/v1alpha1
kind: Foo
metadata:
name: foo0
spec:
servers:
- hosts:
- foo.example.com
- bar.example.com
- hosts:
- baz.example.com
$ kubectl apply -f crd-instance.yaml
- Print instance of CRD:
$ kubectl get foos foo0
NAME HOSTS
foo0 [foo.example.com bar.example.com]
EXPECTED
Notice that only the first array of hosts is printed (missing second array [baz.example.com]
). We would expect that both arrays would have been printed. If we specifically request the JSONPath, then it prints correctly.
$ kubectl get foos foo0 -o jsonpath='{.spec.servers[*].hosts}'
[foo.example.com bar.example.com] [baz.example.com]
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 6
- Comments: 40 (19 by maintainers)
Commits related to this issue
- Change VGPU device and passthrough devices to print unpacked information in kubectl get output We added support to print VGPU device/passthrough device related information in PR https://github.com/vm... — committed to srajashekar-vmw/vm-operator-api by srajashekar-vmw 3 years ago
- Change VGPU device and passthrough devices to print unpacked information in kubectl get output (#72) We added support to print VGPU device/passthrough device related information in PR https://github... — committed to vmware-archive/vm-operator-api by srajashekar-vmw 3 years ago
- Change VGPU device and passthrough devices to print unpacked information in kubectl get output (#72) We added support to print VGPU device/passthrough device related information in PR https://github... — committed to vmware-tanzu/vm-operator by srajashekar-vmw 3 years ago
/remove-lifecycle stale
Ping