-
Notifications
You must be signed in to change notification settings - Fork 584
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
🐛 There is no need to check instance refresh if ASG is not found #4662
🐛 There is no need to check instance refresh if ASG is not found #4662
Conversation
c1a103d
to
44969e7
Compare
/test pull-cluster-api-provider-aws-e2e |
44969e7
to
f746b8b
Compare
/test pull-cluster-api-provider-aws-e2e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly LGTM – one minor comment.
Can you please fill the release note on the PR description? The release note, commit and PR title could read something like "Skip instance refresh attempt if ASG does not yet exist".
@@ -323,9 +323,6 @@ func (s *Service) CanStartASGInstanceRefresh(scope *scope.MachinePoolScope) (boo | |||
describeInput := &autoscaling.DescribeInstanceRefreshesInput{AutoScalingGroupName: aws.String(scope.Name())} | |||
refreshes, err := s.ASGClient.DescribeInstanceRefreshesWithContext(context.TODO(), describeInput) | |||
if err != nil { | |||
if awserrors.IsNotFound(err) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the record, this is removed because AWS returns ValidationError
instead of a clear "not found" code, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly. It never returns an error that would match IsNotFound()
so it's useless to have the check here.
I left the release note intentionally because I added it here, but I guess it's better to have a more specific one. |
/test pull-cluster-api-provider-aws-e2e |
Co-authored-by: Andreas Sommer <andreas@giantswarm.io>
200b1a9
to
d44d5f5
Compare
/lgtm |
/test pull-cluster-api-provider-aws-e2e |
/test pull-cluster-api-provider-aws-e2e-eks |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: richardcase 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 |
/cherrypick release-2.3 |
@richardcase: #4662 failed to apply on top of branch "release-2.3":
In response to this:
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. |
What type of PR is this?
/kind bug
What this PR does / why we need it:
On this PR we tried to fix #4655 by ignoring the "not found" error when describing instance refreshes resources on AWS. But the AWS API returns a
400
error with codeValidationError
when trying to describe the instance refreshes for a non existing AutoScalingGroup. SinceValidationError
sounds super generic, instead of ignoring that error, on this PR I'm moving the call to find the AutoScalingGroup before defining the function that will check if we can do an instance refresh. That way, if the AutoScalingGroup is nil, we know we can skip checking. Also, we still want to update theLaunchTemplate
when the AutoScalingGroup does not exist, because an error in theLaunchTemplate
may be the root cause why the ASG is not created yet.Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #4655
Special notes for your reviewer:
Unfortunately, there is no easy way to test this change, because
ReconcileLaunchTemplate
, which is the one receiving the anonymous function that we want to modify here is mocked.Checklist:
Release note: