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
b678e2ff
Commit
b678e2ff
authored
Jun 03, 2015
by
Prashanth Balasubramanian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Nodes returns transport and scheme in spite of port requirements
parent
640c40da
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
rest.go
pkg/registry/minion/rest.go
+5
-5
No files found.
pkg/registry/minion/rest.go
View file @
b678e2ff
...
@@ -129,7 +129,7 @@ func MatchNode(label labels.Selector, field fields.Selector) generic.Matcher {
...
@@ -129,7 +129,7 @@ func MatchNode(label labels.Selector, field fields.Selector) generic.Matcher {
}
}
}
}
// ResourceLocation returns a
URL to which one can
send traffic for the specified node.
// ResourceLocation returns a
n URL and transport which one can use to
send traffic for the specified node.
func
ResourceLocation
(
getter
ResourceGetter
,
connection
client
.
ConnectionInfoGetter
,
ctx
api
.
Context
,
id
string
)
(
*
url
.
URL
,
http
.
RoundTripper
,
error
)
{
func
ResourceLocation
(
getter
ResourceGetter
,
connection
client
.
ConnectionInfoGetter
,
ctx
api
.
Context
,
id
string
)
(
*
url
.
URL
,
http
.
RoundTripper
,
error
)
{
name
,
portReq
,
valid
:=
util
.
SplitPort
(
id
)
name
,
portReq
,
valid
:=
util
.
SplitPort
(
id
)
if
!
valid
{
if
!
valid
{
...
@@ -143,15 +143,15 @@ func ResourceLocation(getter ResourceGetter, connection client.ConnectionInfoGet
...
@@ -143,15 +143,15 @@ func ResourceLocation(getter ResourceGetter, connection client.ConnectionInfoGet
node
:=
nodeObj
.
(
*
api
.
Node
)
node
:=
nodeObj
.
(
*
api
.
Node
)
host
:=
node
.
Name
// TODO: use node's IP, don't expect the name to resolve.
host
:=
node
.
Name
// TODO: use node's IP, don't expect the name to resolve.
if
portReq
!=
""
{
return
&
url
.
URL
{
Host
:
net
.
JoinHostPort
(
host
,
portReq
)},
nil
,
nil
}
scheme
,
port
,
transport
,
err
:=
connection
.
GetConnectionInfo
(
host
)
scheme
,
port
,
transport
,
err
:=
connection
.
GetConnectionInfo
(
host
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
nil
,
err
return
nil
,
nil
,
err
}
}
if
portReq
!=
""
{
return
&
url
.
URL
{
Scheme
:
scheme
,
Host
:
net
.
JoinHostPort
(
host
,
portReq
)},
transport
,
nil
}
return
&
url
.
URL
{
return
&
url
.
URL
{
Scheme
:
scheme
,
Scheme
:
scheme
,
Host
:
net
.
JoinHostPort
(
Host
:
net
.
JoinHostPort
(
...
...
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