Skip to content
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

Fix up alignment of columns w/ namespaces. #10851

Merged
merged 2 commits into from
Jul 9, 2015

Conversation

jbeda
Copy link
Contributor

@jbeda jbeda commented Jul 7, 2015

Fixes #10842

All issues for types that use "extra lines" for extended information. Two issues fixed: (1) When namespaces are listed an extra column isn't inserted for extra lines and (2) trailing tabs aren't inserted when label columns are specified.

This code should probably move to a more explicit model of putting data into "cells".

Also updated list of resources for help output for kubectl get.

@jbeda jbeda force-pushed the namespace-align branch from 3aa375e to addd73c Compare July 7, 2015 19:07
@jbeda jbeda changed the title Fix up alignment of columns for services w/ namespaces. Fix up alignment of columns w/ namespaces. Jul 7, 2015
@k8s-bot
Copy link

k8s-bot commented Jul 7, 2015

GCE e2e build/test passed for commit 3aa375e52ddb98df6755cc5afb83f00c77e18409.

@jbeda jbeda force-pushed the namespace-align branch from addd73c to 578cf29 Compare July 7, 2015 19:22
@k8s-bot
Copy link

k8s-bot commented Jul 7, 2015

GCE e2e build/test failed for commit addd73cdcb546bd0baaa834d32fe8474ebb4917f.

@k8s-bot
Copy link

k8s-bot commented Jul 7, 2015

GCE e2e build/test failed for commit 578cf2906e580f473dbeb82147b0937d79a62c83.

@yujuhong
Copy link
Contributor

yujuhong commented Jul 7, 2015

@jbeda, we are on a api/cli freeze for v1.0. I am moving this to v1.0-post. Feel free to comment and/or move it back if you think this PR should make it in v1.0.

@yujuhong yujuhong added this to the v1.0-post milestone Jul 7, 2015
@jbeda
Copy link
Contributor Author

jbeda commented Jul 8, 2015

Up to you, but there is a good chance that users will be very confused by
misaligned output. I was.

This should be a pretty safe PR.
On Jul 7, 2015 3:36 PM, "Yu-Ju Hong" [email protected] wrote:

@jbeda https://github.com/jbeda, we are on a api/cli freeze for v1.0. I
am moving this to v1.0-post. Feel free to comment and/or move it back if
you think this PR should make it in v1.0.


Reply to this email directly or view it on GitHub
#10851 (comment)
.

@yujuhong
Copy link
Contributor

yujuhong commented Jul 8, 2015

This should be a pretty safe PR.

I agree, but it isn't really up to me :) @bgrant0607 stated that only p0 bug fixes should go in.

/cc @jlowdermilk, what do you think?

@j3ffml
Copy link
Contributor

j3ffml commented Jul 8, 2015

I think it's worth adding, provided it goes in with an Example that tests the full expected output, along the lines of https://github.com/GoogleCloudPlatform/kubernetes/blob/master/pkg/kubectl/cmd/cmd_test.go#L244

@jbeda
Copy link
Contributor Author

jbeda commented Jul 8, 2015

I'll try to add a test today if I can find the time. Note that the test you pointed at doesn't test the full output -- only that things don't crash. I'll see what I can do to test that the columns line up.

@j3ffml
Copy link
Contributor

j3ffml commented Jul 8, 2015

It actually does test full output. Golang examples compare stdout with the contents of the output comment at the bottom. Kind of a weird pattern but easy to use.

@jbeda
Copy link
Contributor Author

jbeda commented Jul 8, 2015

@jlowdermilk I think I knew that at one point. Seriously non-intuitive though. I'll add a test that handles both label columns and "extra lines".

@jbeda
Copy link
Contributor Author

jbeda commented Jul 8, 2015

I'm having a hard time making this work with lines with trailing whitespace. I think this is a golang issue: golang/go#6416. I'll probably write a "trailing whitespace removal" filter stream to put between the writer and stdout in the test. That'll have to wait for later though as I'm probably out of time for the day.

@jbeda jbeda force-pushed the namespace-align branch from 578cf29 to 8cdcbeb Compare July 9, 2015 00:12
@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm.

@googlebot googlebot added cla: no and removed cla: yes labels Jul 9, 2015
@jbeda jbeda force-pushed the namespace-align branch from 8cdcbeb to 94c6223 Compare July 9, 2015 00:13
@googlebot
Copy link

CLAs look good, thanks!

@googlebot googlebot added cla: yes and removed cla: no labels Jul 9, 2015
@jbeda
Copy link
Contributor Author

jbeda commented Jul 9, 2015

@jlowdermilk PTAL -- test there now. Was more difficult than it should have been :/

@k8s-bot
Copy link

k8s-bot commented Jul 9, 2015

GCE e2e build/test passed for commit 8cdcbeba7dfd07dc312d444b9cd9687710b3e281.

@k8s-bot
Copy link

k8s-bot commented Jul 9, 2015

GCE e2e build/test passed for commit 94c6223ae819e3daef44d7c27a1d28f96dd35536.

@j3ffml
Copy link
Contributor

j3ffml commented Jul 9, 2015

LGTM, thanks for adding test. Sorry it ended up being such a pain.

@jbeda
Copy link
Contributor Author

jbeda commented Jul 9, 2015

@jlowdermilk Not sure how you guys are merging these days so I'll leave it to you to merge. Don't want to step on toes.

@j3ffml
Copy link
Contributor

j3ffml commented Jul 9, 2015

Thanks @jbeda. We're in merge freeze (excepting p0 bugfixes) until 1.0 is cut, so this will probably get merged next week.

jbeda added 2 commits July 9, 2015 08:59
Fixes kubernetes#10842

All issues for types that use "extra lines" for extended information.  Two issues fixed: (1) When namespaces are listed an extra column isn't inserted for extra lines and (2) trailing tabs aren't inserted when label columns are specified.

This code should probably move to a more explicit model of putting data into "cells".

The test for this hits golang/go#6416 and so I introduced a "LineDelimiter" writer filter to make white space more visible.
@jbeda jbeda force-pushed the namespace-align branch from 94c6223 to 0426ab3 Compare July 9, 2015 15:59
@k8s-bot
Copy link

k8s-bot commented Jul 9, 2015

GCE e2e build/test passed for commit 0426ab3.

@bgrant0607
Copy link
Member

See also #10936

@j3ffml j3ffml added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 9, 2015
@j3ffml
Copy link
Contributor

j3ffml commented Jul 9, 2015

With @bgrant0607's permission, adding ok-to-merge.

Risk: low. This fixes misaligned kubectl output and includes unit test to catch regressions.

vmarmol added a commit that referenced this pull request Jul 9, 2015
Fix up alignment of columns w/ namespaces.
@vmarmol vmarmol merged commit 4d637d0 into kubernetes:master Jul 9, 2015
@j3ffml
Copy link
Contributor

j3ffml commented Jul 9, 2015

Fixes #10818.

@mbforbes
Copy link
Contributor

mbforbes commented Jul 9, 2015

This broke shippable as it introduces syntax that isn't valid for Go 1.3.

jbeda added a commit to jbeda/kubernetes that referenced this pull request Jul 9, 2015
vmarmol added a commit that referenced this pull request Jul 9, 2015
Fix up #10851 to be golang 1.3 compatible.
@jbeda jbeda deleted the namespace-align branch October 13, 2016 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kubectl get pods ports column mis-aligned with --all-namespaces
8 participants