Skip to content

Commit

Permalink
Merge pull request #16 from DataDog/eric.mountain/filter-state-running
Browse files Browse the repository at this point in the history
getInstanceByNodeName() needs to filter on running state
  • Loading branch information
EricMountain authored Mar 25, 2020
2 parents 03c9acf + e950b8b commit 984a3f3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/cloudprovider/providers/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -4343,6 +4343,10 @@ func (c *Cloud) getInstanceByNodeName(nodeName types.NodeName) (*ec2.Instance, e
instance, err = c.findInstanceByNodeName(nodeName)
} else {
instance, err = c.getInstanceByID(string(awsID))
// Unless it's running, pretend it was not found
if err == nil && *instance.State.Name != "running" {
instance = nil
}
}
if err == nil && instance == nil {
return nil, cloudprovider.InstanceNotFound
Expand Down

0 comments on commit 984a3f3

Please sign in to comment.