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
99da56fb
Commit
99da56fb
authored
Mar 13, 2015
by
Justin Santa Barbara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix problems identified in review
parent
bc16d83a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
6 deletions
+6
-6
cloud.go
pkg/cloudprovider/cloud.go
+1
-1
nodecontroller.go
pkg/cloudprovider/controller/nodecontroller.go
+3
-3
fake.go
pkg/cloudprovider/fake/fake.go
+1
-1
vagrant.go
pkg/cloudprovider/vagrant/vagrant.go
+1
-1
No files found.
pkg/cloudprovider/cloud.go
View file @
99da56fb
...
...
@@ -57,7 +57,7 @@ type TCPLoadBalancer interface {
// Instances is an abstract, pluggable interface for sets of instances.
type
Instances
interface
{
//
IPAddress returns an IP addres
s of the specified instance.
//
NodeAddresses returns the addresse
s of the specified instance.
NodeAddresses
(
name
string
)
([]
api
.
NodeAddress
,
error
)
// ExternalID returns the cloud provider ID of the specified instance.
ExternalID
(
name
string
)
(
string
,
error
)
...
...
pkg/cloudprovider/controller/nodecontroller.go
View file @
99da56fb
...
...
@@ -274,7 +274,7 @@ func (s *NodeController) PopulateAddresses(nodes *api.NodeList) (*api.NodeList,
if
err
!=
nil
{
glog
.
Errorf
(
"error getting instance addresses for %s: %v"
,
node
.
Name
,
err
)
}
else
{
api
.
AddToNodeAddresses
(
&
node
.
Status
.
Addresses
,
nodeAddresses
...
)
node
.
Status
.
Addresses
=
nodeAddresses
}
}
}
else
{
...
...
@@ -283,7 +283,7 @@ func (s *NodeController) PopulateAddresses(nodes *api.NodeList) (*api.NodeList,
addr
:=
net
.
ParseIP
(
node
.
Name
)
if
addr
!=
nil
{
address
:=
api
.
NodeAddress
{
Type
:
api
.
NodeLegacyHostIP
,
Address
:
addr
.
String
()}
api
.
AddToNodeAddresses
(
&
node
.
Status
.
Addresses
,
address
)
node
.
Status
.
Addresses
=
[]
api
.
NodeAddress
{
address
}
}
else
{
addrs
,
err
:=
s
.
lookupIP
(
node
.
Name
)
if
err
!=
nil
{
...
...
@@ -292,7 +292,7 @@ func (s *NodeController) PopulateAddresses(nodes *api.NodeList) (*api.NodeList,
glog
.
Errorf
(
"No ip address for node %v"
,
node
.
Name
)
}
else
{
address
:=
api
.
NodeAddress
{
Type
:
api
.
NodeLegacyHostIP
,
Address
:
addrs
[
0
]
.
String
()}
api
.
AddToNodeAddresses
(
&
node
.
Status
.
Addresses
,
address
)
node
.
Status
.
Addresses
=
[]
api
.
NodeAddress
{
address
}
}
}
}
...
...
pkg/cloudprovider/fake/fake.go
View file @
99da56fb
...
...
@@ -118,7 +118,7 @@ func (f *FakeCloud) DeleteTCPLoadBalancer(name, region string) error {
// NodeAddresses is a test-spy implementation of Instances.NodeAddresses.
// It adds an entry "node-addresses" into the internal method call record.
func
(
f
*
FakeCloud
)
NodeAddresses
(
instance
string
)
([]
api
.
NodeAddress
,
error
)
{
f
.
addCall
(
"
ip-addres
s"
)
f
.
addCall
(
"
node-addresse
s"
)
return
f
.
Addresses
,
f
.
Err
}
...
...
pkg/cloudprovider/vagrant/vagrant.go
View file @
99da56fb
...
...
@@ -119,7 +119,7 @@ func (v *VagrantCloud) getInstanceByAddress(address string) (*SaltMinion, error)
return
nil
,
fmt
.
Errorf
(
"unable to find instance for address: %s"
,
address
)
}
// NodeAddresses returns the NodeAddress of a particular machine instance.
// NodeAddresses returns the NodeAddress
es
of a particular machine instance.
func
(
v
*
VagrantCloud
)
NodeAddresses
(
instance
string
)
([]
api
.
NodeAddress
,
error
)
{
// Due to vagrant not running with a dedicated DNS setup, we return the IP address of a minion as its hostname at this time
minion
,
err
:=
v
.
getInstanceByAddress
(
instance
)
...
...
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