mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #72559 from andrewsykim/72499
Delete non-existent cloud provider nodes with Ready condition Unknown
This commit is contained in:
commit
d3aa7b2cee
@ -146,18 +146,6 @@ func (c *CloudNodeLifecycleController) MonitorNodes() {
|
||||
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
|
||||
// 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
|
||||
|
@ -24,6 +24,7 @@ import (
|
||||
|
||||
"k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/client-go/informers"
|
||||
coreinformers "k8s.io/client-go/informers/core/v1"
|
||||
"k8s.io/client-go/kubernetes/fake"
|
||||
@ -164,7 +165,9 @@ func Test_NodesDeleted(t *testing.T) {
|
||||
fakeCloud: &fakecloud.FakeCloud{
|
||||
ExistsByProviderID: false,
|
||||
},
|
||||
deleteNodes: []*v1.Node{},
|
||||
deleteNodes: []*v1.Node{
|
||||
testutil.NewNode("node0"),
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "node ready condition is unknown, node exists",
|
||||
@ -191,7 +194,11 @@ func Test_NodesDeleted(t *testing.T) {
|
||||
Clientset: fake.NewSimpleClientset(),
|
||||
},
|
||||
fakeCloud: &fakecloud.FakeCloud{
|
||||
NodeShutdown: false,
|
||||
ExistsByProviderID: true,
|
||||
ExtID: map[types.NodeName]string{
|
||||
types.NodeName("node0"): "foo://12345",
|
||||
},
|
||||
},
|
||||
deleteNodes: []*v1.Node{},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user