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
20c30d5c
Commit
20c30d5c
authored
Jan 04, 2019
by
andrewsykim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delete non-existent nodes with Ready condition Unknown
parent
8a60166f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
13 deletions
+8
-13
node_lifecycle_controller.go
pkg/controller/cloud/node_lifecycle_controller.go
+0
-12
node_lifecycle_controller_test.go
pkg/controller/cloud/node_lifecycle_controller_test.go
+8
-1
No files found.
pkg/controller/cloud/node_lifecycle_controller.go
View file @
20c30d5c
...
@@ -146,18 +146,6 @@ func (c *CloudNodeLifecycleController) MonitorNodes() {
...
@@ -146,18 +146,6 @@ func (c *CloudNodeLifecycleController) MonitorNodes() {
continue
continue
}
}
// node condition is unknown so we should not try to update it
if
status
==
v1
.
ConditionUnknown
{
continue
}
// status for NodeReady should be false at this point, this check
// is here as a fail safe in the case a new node condition is added
// without consideration of this controller
if
status
!=
v1
.
ConditionFalse
{
continue
}
// we need to check this first to get taint working in similar in all cloudproviders
// we need to check this first to get taint working in similar in all cloudproviders
// current problem is that shutdown nodes are not working in similar way ie. all cloudproviders
// current problem is that shutdown nodes are not working in similar way ie. all cloudproviders
// does not delete node from kubernetes cluster when instance it is shutdown see issue #46442
// does not delete node from kubernetes cluster when instance it is shutdown see issue #46442
...
...
pkg/controller/cloud/node_lifecycle_controller_test.go
View file @
20c30d5c
...
@@ -24,6 +24,7 @@ import (
...
@@ -24,6 +24,7 @@ import (
"k8s.io/api/core/v1"
"k8s.io/api/core/v1"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/informers"
"k8s.io/client-go/informers"
coreinformers
"k8s.io/client-go/informers/core/v1"
coreinformers
"k8s.io/client-go/informers/core/v1"
"k8s.io/client-go/kubernetes/fake"
"k8s.io/client-go/kubernetes/fake"
...
@@ -164,7 +165,9 @@ func Test_NodesDeleted(t *testing.T) {
...
@@ -164,7 +165,9 @@ func Test_NodesDeleted(t *testing.T) {
fakeCloud
:
&
fakecloud
.
FakeCloud
{
fakeCloud
:
&
fakecloud
.
FakeCloud
{
ExistsByProviderID
:
false
,
ExistsByProviderID
:
false
,
},
},
deleteNodes
:
[]
*
v1
.
Node
{},
deleteNodes
:
[]
*
v1
.
Node
{
testutil
.
NewNode
(
"node0"
),
},
},
},
{
{
name
:
"node ready condition is unknown, node exists"
,
name
:
"node ready condition is unknown, node exists"
,
...
@@ -191,7 +194,11 @@ func Test_NodesDeleted(t *testing.T) {
...
@@ -191,7 +194,11 @@ func Test_NodesDeleted(t *testing.T) {
Clientset
:
fake
.
NewSimpleClientset
(),
Clientset
:
fake
.
NewSimpleClientset
(),
},
},
fakeCloud
:
&
fakecloud
.
FakeCloud
{
fakeCloud
:
&
fakecloud
.
FakeCloud
{
NodeShutdown
:
false
,
ExistsByProviderID
:
true
,
ExistsByProviderID
:
true
,
ExtID
:
map
[
types
.
NodeName
]
string
{
types
.
NodeName
(
"node0"
)
:
"foo://12345"
,
},
},
},
deleteNodes
:
[]
*
v1
.
Node
{},
deleteNodes
:
[]
*
v1
.
Node
{},
},
},
...
...
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