mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 22:46:12 +00:00
Merge pull request #62443 from WanLinghao/crd_column_fix
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. kubectl get CRD resources with --server-print=true column name error **What this PR does / why we need it**: Here's a bunch of kubectl get command execution and their outputs. my-crd is the user-define CRD resource. 1. ``` kubectl get pod --all-namespaces --server-print=true NAMESPACE NAME READY STATUS RESTARTS AGE test-ns test-pod 1/1 running 1 15m ``` 2. ``` kubectl get my-crd --all-namespaces --server-print=false NAMESPACE NAME AGE test-ns test-crd 21m ``` 3. ``` kubectl get my-crd --all-namespaces --server-print=true NAMESPACE NAME CREATED AT test-ns test-crd 21m ``` Here's the problem 1. Example 3 isn't consistent with example 1 and 2 2. CREATED AT 21m doesn't make sense This patch fix this. **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ```
This commit is contained in:
commit
d9ba054901
@ -42,7 +42,7 @@ var swaggerMetadataDescriptions = metav1.ObjectMeta{}.SwaggerDoc()
|
||||
func New(extensions spec.Extensions) (rest.TableConvertor, error) {
|
||||
headers := []metav1beta1.TableColumnDefinition{
|
||||
{Name: "Name", Type: "string", Format: "name", Description: swaggerMetadataDescriptions["name"]},
|
||||
{Name: "Created At", Type: "date", Description: swaggerMetadataDescriptions["creationTimestamp"]},
|
||||
{Name: "Age", Type: "date", Description: swaggerMetadataDescriptions["creationTimestamp"]},
|
||||
}
|
||||
c := &convertor{
|
||||
headers: headers,
|
||||
|
Loading…
Reference in New Issue
Block a user