Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return error if aws fail to find nodegroup for node #2247

Merged
merged 1 commit into from
Aug 19, 2019

Conversation

Jeffwan
Copy link
Contributor

@Jeffwan Jeffwan commented Aug 10, 2019

Resolve #2161

When CA scales down node, node is still in cache. aws manager return nil, nil for node doesn't belong to existing node group.

@jaypipes

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 10, 2019
@krzysztof-jastrzebski
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 19, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: krzysztof-jastrzebski

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 19, 2019
@k8s-ci-robot k8s-ci-robot merged commit 5f260b3 into kubernetes:master Aug 19, 2019
@Jeffwan Jeffwan deleted the fix-2161 branch August 19, 2019 17:17
@@ -108,7 +108,7 @@ func (aws *awsCloudProvider) NodeGroupForNode(node *apiv1.Node) (cloudprovider.N
asg := aws.awsManager.GetAsgForInstance(*ref)

if asg == nil {
return nil, nil
return nil, fmt.Errorf("cannot find ASG for node %v", ref.Name)
Copy link

Choose a reason for hiding this comment

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

We return an error here, but this method gets called looking for Kubernetes nodes that aren't part of a discovered ASG (in my case, my master machines are part of an ASG, but not an ASG that the cluster autoscaler discovers or touches).

In core.getNodeInfosForGroups, we call on this method, and any errors that come back out now cause that function to fail earlier than it used to. It was written to accommodate the nil return here, without an accompanying error.

See #2345 for what may be a consequence of this change (with initial commentary from @losipiuk).

@seh
Copy link

seh commented Sep 18, 2019

See #2357 for reverting this patch against the 1.16 and later versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nil pointer dereference while fetching node instances for aws asg
4 participants