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
82a69b28
Commit
82a69b28
authored
Aug 25, 2017
by
Josh Horwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor method name as per comments
parent
3528ceb2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
node_controller.go
pkg/controller/cloud/node_controller.go
+3
-3
node_controller_test.go
pkg/controller/cloud/node_controller_test.go
+1
-1
No files found.
pkg/controller/cloud/node_controller.go
View file @
82a69b28
...
@@ -237,7 +237,7 @@ func (cnc *CloudNodeController) MonitorNode() {
...
@@ -237,7 +237,7 @@ func (cnc *CloudNodeController) MonitorNode() {
if
currentReadyCondition
.
Status
!=
v1
.
ConditionTrue
{
if
currentReadyCondition
.
Status
!=
v1
.
ConditionTrue
{
// Check with the cloud provider to see if the node still exists. If it
// Check with the cloud provider to see if the node still exists. If it
// doesn't, delete the node immediately.
// doesn't, delete the node immediately.
exists
,
err
:=
ensureNodeExistsByProviderIDOr
Name
(
instances
,
node
)
exists
,
err
:=
ensureNodeExistsByProviderIDOr
ExternalID
(
instances
,
node
)
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Errorf
(
"Error getting data for node %s from cloud: %v"
,
node
.
Name
,
err
)
glog
.
Errorf
(
"Error getting data for node %s from cloud: %v"
,
node
.
Name
,
err
)
continue
continue
...
@@ -382,8 +382,8 @@ func excludeTaintFromList(taints []v1.Taint, toExclude v1.Taint) []v1.Taint {
...
@@ -382,8 +382,8 @@ func excludeTaintFromList(taints []v1.Taint, toExclude v1.Taint) []v1.Taint {
return
newTaints
return
newTaints
}
}
// ensureNodeExistsByProviderIDOr
Name first checks if the instance exists by the provider id and then by
node name
// ensureNodeExistsByProviderIDOr
ExternalID first checks if the instance exists by the provider id and then by calling external id with
node name
func
ensureNodeExistsByProviderIDOr
Name
(
instances
cloudprovider
.
Instances
,
node
*
v1
.
Node
)
(
bool
,
error
)
{
func
ensureNodeExistsByProviderIDOr
ExternalID
(
instances
cloudprovider
.
Instances
,
node
*
v1
.
Node
)
(
bool
,
error
)
{
exists
,
err
:=
instances
.
InstanceExistsByProviderID
(
node
.
Spec
.
ProviderID
)
exists
,
err
:=
instances
.
InstanceExistsByProviderID
(
node
.
Spec
.
ProviderID
)
if
err
!=
nil
{
if
err
!=
nil
{
providerIDErr
:=
err
providerIDErr
:=
err
...
...
pkg/controller/cloud/node_controller_test.go
View file @
82a69b28
...
@@ -128,7 +128,7 @@ func TestEnsureNodeExistsByProviderIDOrNodeName(t *testing.T) {
...
@@ -128,7 +128,7 @@ func TestEnsureNodeExistsByProviderIDOrNodeName(t *testing.T) {
}
}
instances
,
_
:=
fc
.
Instances
()
instances
,
_
:=
fc
.
Instances
()
exists
,
err
:=
ensureNodeExistsByProviderIDOr
Name
(
instances
,
tc
.
node
)
exists
,
err
:=
ensureNodeExistsByProviderIDOr
ExternalID
(
instances
,
tc
.
node
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Error
(
err
)
t
.
Error
(
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