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
8d964a7d
Commit
8d964a7d
authored
Feb 09, 2016
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #20372 from dpratt/aws-private-ip
Auto commit by PR queue bot
parents
f36b604b
57782459
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
aws.go
pkg/cloudprovider/providers/aws/aws.go
+13
-6
No files found.
pkg/cloudprovider/providers/aws/aws.go
View file @
8d964a7d
...
...
@@ -650,19 +650,26 @@ func (aws *AWSCloud) NodeAddresses(name string) ([]api.NodeAddress, error) {
return
nil
,
err
}
if
self
.
nodeName
==
name
||
len
(
name
)
==
0
{
addresses
:=
[]
api
.
NodeAddress
{}
internalIP
,
err
:=
aws
.
metadata
.
GetMetadata
(
"local-ipv4"
)
if
err
!=
nil
{
return
nil
,
err
}
addresses
=
append
(
addresses
,
api
.
NodeAddress
{
Type
:
api
.
NodeInternalIP
,
Address
:
internalIP
})
// Legacy compatibility: the private ip was the legacy host ip
addresses
=
append
(
addresses
,
api
.
NodeAddress
{
Type
:
api
.
NodeLegacyHostIP
,
Address
:
internalIP
})
externalIP
,
err
:=
aws
.
metadata
.
GetMetadata
(
"public-ipv4"
)
if
err
!=
nil
{
return
nil
,
err
//TODO: It would be nice to be able to determine the reason for the failure,
// but the AWS client masks all failures with the same error description.
glog
.
V
(
2
)
.
Info
(
"Could not determine public IP from AWS metadata."
)
}
else
{
addresses
=
append
(
addresses
,
api
.
NodeAddress
{
Type
:
api
.
NodeExternalIP
,
Address
:
externalIP
})
}
return
[]
api
.
NodeAddress
{
{
Type
:
api
.
NodeInternalIP
,
Address
:
internalIP
},
{
Type
:
api
.
NodeLegacyHostIP
,
Address
:
internalIP
},
{
Type
:
api
.
NodeExternalIP
,
Address
:
externalIP
},
},
nil
return
addresses
,
nil
}
instance
,
err
:=
aws
.
getInstanceByNodeName
(
name
)
if
err
!=
nil
{
...
...
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