add hostPorts to pod describer #57507
Conversation
if strings.Contains(hostPortString, ",") { | ||
w.Write(LEVEL_2, "HostPorts:\t%s\n", hostPortString) | ||
} else { | ||
if len(hostPortString) == 1 { |
php-coder
Dec 21, 2017
•
Contributor
This condition looks weird. When the length of the string can be equal to 1?
This condition looks weird. When the length of the string can be equal to 1?
dixudx
Dec 22, 2017
Author
Member
My mistake. Updated. PTAL. Thanks.
My mistake. Updated. PTAL. Thanks.
if len(hostPortString) == 0 { | ||
w.Write(LEVEL_2, "HostPort:\t<none>\n") | ||
} else { | ||
w.Write(LEVEL_2, "HostPort:\t%s\n", hostPortString) |
php-coder
Dec 22, 2017
Contributor
I think that having more if
conditions just for respecting plural form doesn't worth it. This code also could benefit from using stringOrNone()
:
w.Write(LEVEL_2, "HostPorts:\t%s\n", stringOrNone(hostPortString))
I think that having more if
conditions just for respecting plural form doesn't worth it. This code also could benefit from using stringOrNone()
:
w.Write(LEVEL_2, "HostPorts:\t%s\n", stringOrNone(hostPortString))
@kubernetes/sig-cli-pr-reviews PTAL. Thanks. |
/assign juanvallejo |
} | ||
hostPortString := describeContainerHostPorts(container.Ports) | ||
if strings.Contains(hostPortString, ",") { | ||
w.Write(LEVEL_2, "HostPorts:\t%s\n", hostPortString) |
juanvallejo
Jan 8, 2018
Member
nit: s/HostPorts/Host Ports/
nit: s/HostPorts/Host Ports/
if strings.Contains(hostPortString, ",") { | ||
w.Write(LEVEL_2, "HostPorts:\t%s\n", hostPortString) | ||
} else { | ||
w.Write(LEVEL_2, "HostPort:\t%s\n", stringOrNone(hostPortString)) |
juanvallejo
Jan 8, 2018
Member
nit: s/HostPort/Host Port/
nit: s/HostPort/Host Port/
@dixudx one nit, otherwise lgtm |
@juanvallejo @php-coder Updated. PTAL. Thanks. |
/lgtm |
ping @smarterclayton @kubernetes/sig-cli-maintainers for approval. Thanks. |
/test all Tests are more than 96 hours old. Re-running tests. |
/lgtm |
/test all Tests are more than 96 hours old. Re-running tests. |
/approve no-issue |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k, dixudx, php-coder, soltysh Associated issue requirement bypassed by: deads2k The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/test all [submit-queue is verifying that this PR is safe to merge] |
/test all Tests are more than 96 hours old. Re-running tests. |
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here. |
ff626a3
into
kubernetes:master
What this PR does / why we need it:
Missing
HostPorts
when describing podsWhich 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:
/assign @mengqiy @shiywang
Release note: