-
Notifications
You must be signed in to change notification settings - Fork 42.8k
Printing CRDs with priority set will hide columns #65196
Copy link
Copy link
Closed
Labels
area/custom-resourceskind/documentationCategorizes issue or PR as related to documentation.Categorizes issue or PR as related to documentation.lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.Denotes an issue or PR that has aged beyond stale and will be auto-closed.sig/cliCategorizes an issue or PR as relevant to SIG CLI.Categorizes an issue or PR as relevant to SIG CLI.
Description
Is this a BUG REPORT or FEATURE REQUEST?:
/kind bug
What happened:
Create a CRD:
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: foos.samplecontroller.k8s.io
spec:
group: samplecontroller.k8s.io
version: v1alpha1
names:
kind: Foo
plural: foos
scope: Namespaced
validation:
openAPIV3Schema:
properties:
spec:
properties:
replicas:
type: integer
minimum: 1
maximum: 10
additionalPrinterColumns:
- name: replicas
type: integer
JSONPath: .spec.replicas
priority: 1and then its instance:
apiVersion: samplecontroller.k8s.io/v1alpha1
kind: Foo
metadata:
name: example-foo
spec:
deploymentName: example-foo
replicas: 1Invoking kubectl get foos.samplecontroller.k8s.io will return only the NAME column omitting the additionalPrinterColumns that have priority set to a value > 0.
Invoking kubectl get foos.samplecontroller.k8s.io -o wide will return all the columns properly.
The culprit lies here:
kubernetes/pkg/printers/humanreadable.go
Line 351 in 23cd143
| if !options.Wide && column.Priority != 0 { |
/cc @sttts
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area/custom-resourceskind/documentationCategorizes issue or PR as related to documentation.Categorizes issue or PR as related to documentation.lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.Denotes an issue or PR that has aged beyond stale and will be auto-closed.sig/cliCategorizes an issue or PR as relevant to SIG CLI.Categorizes an issue or PR as relevant to SIG CLI.