Support wide output format for get commands (-o wide)#3129
Conversation
|
Hi @yeedove. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
mlavacca
left a comment
There was a problem hiding this comment.
This looks good to me, I left a minor comment 👍
/ok-to-test
jongwooo
left a comment
There was a problem hiding this comment.
The OutputFormatWIDE type is not currently handled by the switch statement below. Please add a case statement for OutputFormatWIDE type:
gateway-api/gwctl/pkg/printer/policies.go
Lines 88 to 96 in e50fd3b
gateway-api/gwctl/pkg/printer/policies.go
Lines 129 to 137 in e50fd3b
gauravkghildiyal
left a comment
There was a problem hiding this comment.
Thanks @yeedove! This looks great, just have one minor request which should be quite straightforward.
| if wide { | ||
| columnNames = []string{"NAMESPACE", "NAME", "TYPE", "REFERRED BY ROUTES", "AGE", "POLICIES"} | ||
| } else { | ||
| columnNames = []string{"NAMESPACE", "NAME", "TYPE", "REFERRED BY ROUTES", "AGE"} |
There was a problem hiding this comment.
I know this is a bit different from what's documented but I've come to realize that we should avoid any parameter from being displayed which needs additional calculations.
Calculating things like "REFERRED BY ROUTES" and "POLICIES" will take additional time (which becomes significant when there's lot's of resources). Hence it's preferrable to only include them in the -o wide format and not as a default.
tl;dr: Can you please move REFERRED BY ROUTES to wide format as well?
(In case you are wondering, we'll separately work on not calculating the additional values by default int the resourceModel -- as of now, that distinction doesn't exist`
|
Can you please also edit the release note and avoid the |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gauravkghildiyal, yeedove The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/lgtm |
…s#3129) * Support wide output format for get commands (-o wide) * Add a case statement for OutputFormatWide type * Move REFERRED BY ROUTES to wide format * Move REFERRED BY ROUTES to wide format
…s#3129) * Support wide output format for get commands (-o wide) * Add a case statement for OutputFormatWide type * Move REFERRED BY ROUTES to wide format * Move REFERRED BY ROUTES to wide format
What type of PR is this?
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #2889
Does this PR introduce a user-facing change?: