-
Notifications
You must be signed in to change notification settings - Fork 39.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Give APIServer pretty column output #67747
Give APIServer pretty column output #67747
Conversation
{Name: "Name", Type: "string", Format: "name", Description: swaggerMetadataDescriptions["name"]}, | ||
{Name: "Service", Type: "string", Description: "The reference to the service that hosts this API endpoint."}, | ||
{Name: "Available", Type: "string", Description: "Whether this service is available."}, | ||
{Name: "Age", Type: "string", Description: swaggerMetadataDescriptions["creationTimestamp"]}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
didn't we have some special format or type for the age column to be printed properly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure we actually implemented it. I think it would be type=string, format=age or format=duration. I can do a follow up PR and set format duration on all the things (every age column)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's type "date"
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An age string is not a date though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on the wire it's a date, in the kubectl output it's an age. Yes, strange.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the wire it's row.Cells, err = rowFn(obj, m, m.GetName(), ConvertToHumanReadableDateType(m.GetCreationTimestamp()))
on all types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@soltysh you wanted to look into the current code? Anything to add? I don't want to block this due to my comment. Just had the impression we use "date" elsewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did, I'm fine with the current code. It is consistent with the others.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
ColumnDefinitions: []metav1beta1.TableColumnDefinition{ | ||
{Name: "Name", Type: "string", Format: "name", Description: swaggerMetadataDescriptions["name"]}, | ||
{Name: "Service", Type: "string", Description: "The reference to the service that hosts this API endpoint."}, | ||
{Name: "Available", Type: "string", Description: "Whether this service is available."}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while pretty, our mechanism somehow failed if we have to turn a bool into a string. Wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We actually do this for other columns because we're not returning a bool, we're returning a human focused message. I.e. True and False are ok, but we really want to give a user the reason as well, because that answers the why. This is parallel to how pod status, node status, etc work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also the ready column is presented as 0/2
or 2/3
which allows multiple columns to be compressed, improving information density and reducing the number of follow up actions a user needs to take (yes, I know it's not ready, but HOW MUCH is it not ready, etc)
pretty indeed 👍 |
/assign @caesarxuchao |
Simple server side render that prints the implementing service (if any) and the available condition. ``` $ kubectl get apiservice NAME SERVICE AVAILABLE AGE v1. Local True 10m v1.apps Local True 10m v1.authentication.k8s.io Local True 10m v2beta1.autoscaling Local True 10m v1beta1.metrics kube-system/metrics-server False (DiscoveryFailed) 10m ```
0eac96e
to
b06d4b7
Compare
lgtm /assign @sttts |
Any other comments then? |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: smarterclayton, sttts The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest Review the full test history for this PR. Silence the bot with an |
1 similar comment
/retest Review the full test history for this PR. Silence the bot with an |
/retest |
1 similar comment
/retest |
/retest Review the full test history for this PR. Silence the bot with an |
/test all [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md. |
Simple server side render that prints the implementing service (if any)
and the available condition.
@liggitt @deads2k helps to debug why controllers block (aggregate api is down)