Skip to content

Commit b042aae

Browse files
authored
Merge pull request kubernetes#5191 from x13n/scaledown
Don't depend on IsNodeBeingDeleted implementation
2 parents 8dcd3b3 + 6017d85 commit b042aae

File tree

2 files changed

+0
-12
lines changed

2 files changed

+0
-12
lines changed

cluster-autoscaler/core/scaledown/eligibility/eligibility.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,6 @@ func (c *Checker) FilterOutUnremovable(context *context.AutoscalingContext, scal
108108
func (c *Checker) unremovableReasonAndNodeUtilization(context *context.AutoscalingContext, timestamp time.Time, nodeInfo *schedulerframework.NodeInfo, utilLogsQuota *klogx.Quota) (simulator.UnremovableReason, *utilization.Info) {
109109
node := nodeInfo.Node()
110110

111-
// Skip nodes marked to be deleted, if they were marked recently.
112-
// Old-time marked nodes are again eligible for deletion - something went wrong with them
113-
// and they have not been deleted.
114111
if actuation.IsNodeBeingDeleted(node, timestamp) {
115112
klog.V(1).Infof("Skipping %s from delete consideration - the node is currently being deleted", node.Name)
116113
return simulator.CurrentlyBeingDeleted, nil

cluster-autoscaler/core/scaledown/eligibility/eligibility_test.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ func TestFilterOutUnremovable(t *testing.T) {
4646
justDeletedNode.Spec.Taints = []apiv1.Taint{{Key: deletetaint.ToBeDeletedTaint, Value: strconv.FormatInt(now.Unix()-30, 10)}}
4747
SetNodeReadyState(justDeletedNode, true, time.Time{})
4848

49-
tooOldDeletedNode := BuildTestNode("tooOldDeleted", 1000, 10)
50-
tooOldDeletedNode.Spec.Taints = []apiv1.Taint{{Key: deletetaint.ToBeDeletedTaint, Value: strconv.FormatInt(now.Unix()-301, 10)}}
51-
SetNodeReadyState(tooOldDeletedNode, true, time.Time{})
52-
5349
noScaleDownNode := BuildTestNode("noScaleDown", 1000, 10)
5450
noScaleDownNode.Annotations = map[string]string{ScaleDownDisabledKey: "true"}
5551
SetNodeReadyState(noScaleDownNode, true, time.Time{})
@@ -76,11 +72,6 @@ func TestFilterOutUnremovable(t *testing.T) {
7672
nodes: []*apiv1.Node{regularNode, justDeletedNode},
7773
want: []string{"regular"},
7874
},
79-
{
80-
desc: "deleted long time ago stays",
81-
nodes: []*apiv1.Node{regularNode, tooOldDeletedNode},
82-
want: []string{"regular", "tooOldDeleted"},
83-
},
8475
{
8576
desc: "marked no scale down is filtered out",
8677
nodes: []*apiv1.Node{noScaleDownNode, regularNode},

0 commit comments

Comments
 (0)