Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
eea949b3
Commit
eea949b3
authored
Apr 27, 2015
by
Tim Hockin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Print named ports in 'describe service'
Also in 'describe service'. This got missed in all the multiport work.
parent
45d8c97b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
describe.go
pkg/kubectl/describe.go
+2
-1
resource_printer.go
pkg/kubectl/resource_printer.go
+4
-3
No files found.
pkg/kubectl/describe.go
View file @
eea949b3
...
...
@@ -29,6 +29,7 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/fields"
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
"github.com/GoogleCloudPlatform/kubernetes/pkg/types"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
"github.com/golang/glog"
)
...
...
@@ -457,8 +458,8 @@ func describeService(service *api.Service, endpoints *api.Endpoints, events *api
name
=
"<unnamed>"
}
fmt
.
Fprintf
(
out
,
"Port:
\t
%s
\t
%d/%s
\n
"
,
name
,
sp
.
Port
,
sp
.
Protocol
)
fmt
.
Fprintf
(
out
,
"Endpoints:
\t
%s
\t
%s
\n
"
,
name
,
formatEndpoints
(
endpoints
,
util
.
NewStringSet
(
sp
.
Name
)))
}
fmt
.
Fprintf
(
out
,
"Endpoints:
\t
%s
\n
"
,
formatEndpoints
(
endpoints
))
fmt
.
Fprintf
(
out
,
"Session Affinity:
\t
%s
\n
"
,
service
.
Spec
.
SessionAffinity
)
if
events
!=
nil
{
DescribeEvents
(
events
,
out
)
...
...
pkg/kubectl/resource_printer.go
View file @
eea949b3
...
...
@@ -305,7 +305,8 @@ func (h *HumanReadablePrinter) printHeader(columnNames []string, w io.Writer) er
return
nil
}
func
formatEndpoints
(
endpoints
*
api
.
Endpoints
)
string
{
// Pass ports=nil for all ports.
func
formatEndpoints
(
endpoints
*
api
.
Endpoints
,
ports
util
.
StringSet
)
string
{
if
len
(
endpoints
.
Subsets
)
==
0
{
return
"<none>"
}
...
...
@@ -317,7 +318,7 @@ Loop:
ss
:=
&
endpoints
.
Subsets
[
i
]
for
i
:=
range
ss
.
Ports
{
port
:=
&
ss
.
Ports
[
i
]
if
port
.
Name
==
""
{
// TODO: add multi-port support.
if
port
s
==
nil
||
ports
.
Has
(
port
.
Name
)
{
for
i
:=
range
ss
.
Addresses
{
if
len
(
list
)
==
max
{
more
=
true
...
...
@@ -555,7 +556,7 @@ func printServiceList(list *api.ServiceList, w io.Writer) error {
}
func
printEndpoints
(
endpoints
*
api
.
Endpoints
,
w
io
.
Writer
)
error
{
_
,
err
:=
fmt
.
Fprintf
(
w
,
"%s
\t
%s
\n
"
,
endpoints
.
Name
,
formatEndpoints
(
endpoints
))
_
,
err
:=
fmt
.
Fprintf
(
w
,
"%s
\t
%s
\n
"
,
endpoints
.
Name
,
formatEndpoints
(
endpoints
,
nil
))
return
err
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment