-
Notifications
You must be signed in to change notification settings - Fork 570
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
Fail creation of machine pool if no subnets matching filters found #3978
Fail creation of machine pool if no subnets matching filters found #3978
Conversation
Signed-off-by: Marcus Noble <[email protected]>
/test ? |
@Skarlso: The following commands are available to trigger required jobs:
The following commands are available to trigger optional jobs:
Use
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. |
/test pull-cluster-api-provider-aws-e2e-eks |
@@ -526,6 +526,12 @@ func (s *Service) SubnetIDs(scope *scope.MachinePoolScope) ([]string, error) { | |||
for _, subnet := range out.Subnets { | |||
subnetIDs = append(subnetIDs, *subnet.SubnetId) | |||
} | |||
|
|||
if len(subnetIDs) == 0 { |
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.
Hm. So what happens if in the above there are filters and IDs defined? It might be that the list is not empty so the filter might not return anything, but the list still has a subnet ID in it.
I imagine we want that to proceed though and not care about the filter not working, 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.
Yeah in that scenario I'd expect it just to make use of the subnets with the matching IDs.
/cherry-pick release-1.5 |
@AverageMarcus: once the present PR merges, I will cherry-pick it on top of release-1.5 in a new PR and assign it to you. 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. |
/test pull-cluster-api-provider-aws-e2e |
/lgtm until tests @AverageMarcus you can unhold if tests passed :) |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Skarlso 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 |
/hold cancel |
@AverageMarcus: new pull request created: #3988 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:
Currently if when using subnet filters with an AWSMachinePool no subnets are found to match the code will fallback to using any matching the AZs specified on the CR. This is unexpected and in contrast to how AWSMachine is handled in the same situation.
This PR causes an error to be raised if the filters provided result in no subnets matching.
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 #3977
Special notes for your reviewer:
Checklist: