Skip to content
This repository was archived by the owner on Apr 17, 2019. It is now read-only.

Conversation

@mwielgus
Copy link
Contributor

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 12, 2017
@k8s-reviewable
Copy link

This change is Reviewable

@k8s-github-robot
Copy link

[APPROVALNOTIFIER] Needs approval from an approver in each of these OWNERS Files:

We suggest the following people:
cc @piosz
You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

glog.V(1).Infof("%d unregistered nodes present", len(unregisteredNodes))
removedAny, err := removeOldUnregisteredNodes(unregisteredNodes, &autoscalingContext, time.Now())
// There was a problem with removing unregistered nodes. Retry in the next loop.
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are not handling correctly the case when some nodes were removed, but error was observed afterwards: "Some unregistered nodes were removed" should be printed before printing error.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean the error itself message. Yeah - we can have 2 different here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

assert.Equal(t, 1, len(unregisteredNodes))

// Nothing should be removed. The unregistered node is not old enough.
removed, err := removeOldUnregisteredNodes(unregisteredNodes, context, time.Now().Add(-50*time.Minute))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: do not call Now() multiple times. Call it once and remember the value.

@jszczepkowski
Copy link
Contributor

jszczepkowski commented Jan 13, 2017

Just two minor comments, after applying them: LGTM

@mwielgus mwielgus force-pushed the remove-unregistered branch from c025aa7 to 7f50928 Compare January 13, 2017 12:35
@mwielgus mwielgus added the lgtm Indicates that a PR is ready to be merged. label Jan 13, 2017
@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit 1b40b50 into kubernetes-retired:master Jan 13, 2017
mwielgus pushed a commit to kubernetes/autoscaler that referenced this pull request Apr 18, 2017
…ve-unregistered

Automatic merge from submit-queue

Cluster-autoscaler: remove nodes that have been unregistered for a long time

Ref: #2228

cc: @jszczepkowski @fgrzadkowski
mwielgus pushed a commit to kubernetes/autoscaler that referenced this pull request Apr 18, 2017
…ve-unregistered

Automatic merge from submit-queue

Cluster-autoscaler: remove nodes that have been unregistered for a long time

Ref: #2228

cc: @jszczepkowski @fgrzadkowski
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area/autoscaler area/autoscaling cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants