/kind bug
What steps did you take and what happened:
If you terminate an ec2 instance out of band (manually i.e. CAPA didn't do it) and wait long enough such that the instance is no longer returned by a DescribeInstances call, this logic does not work correctly:
The error returned by ec2 looks like this:
InvalidInstanceID.NotFound: The instance ID 'i-xxxxxxxxxxxxx' does not exist
status code: 400, request id: ...
Note the status code is 400. Our awserrors.IsNotFound() has this:
We don't match on http.StatusNotFound (400 != 404). And IsInvalidNotFoundError does this:
We probably need to also check for InvalidInstanceID.NotFound
What did you expect to happen:
The InstanceIfExists call should return nil, nil in this scenario.
Environment:
Or maybe we need to do a regex match on ^Invalid[^.]+\.NotFound$?
I'd just add another case for now, unless you prefer the regex thing
/help
/good-first-issue
/milestone v0.5.0
@ncdc:
This request has been marked as suitable for new contributors.
Please ensure the request meets the requirements listed here.
If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-good-first-issue command.
In response to this:
/help
/good-first-issue
/milestone v0.5.0
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
Can i pick this one and try?
Please do!
@ncdc can i reach you in the K8s slack to ask a few questions?
@cpanato sure thing! #cluster-api-aws channel