-
Notifications
You must be signed in to change notification settings - Fork 578
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
✨ feat: create vpc objects in explicitly provided availability zones #4543
Conversation
Oh totally forgot all the conversion shenanigans. |
695994c
to
8151645
Compare
/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-blocking |
api/v1beta2/network_types.go
Outdated
// AvailabilityZoneList defines a list of Availability Zones in which to create network resources in. | ||
// If defined, both AvailabilityZoneUsageLimit and AvailabilityZoneSelection are ignored. | ||
// +optional | ||
AvailabilityZoneList []string `json:"availabilityZoneList,omitempty"` |
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.
// AvailabilityZoneList defines a list of Availability Zones in which to create network resources in. | |
// If defined, both AvailabilityZoneUsageLimit and AvailabilityZoneSelection are ignored. | |
// +optional | |
AvailabilityZoneList []string `json:"availabilityZoneList,omitempty"` | |
// AvailabilityZoneList defines a list of Availability Zones in which to create network resources in. | |
// Cannot be defined alongside AvailabilityZoneUsageLimit and AvailabilityZoneSelection. | |
// +optional | |
AvailabilityZones []string `json:"availabilityZones,omitempty"` |
We should probably refuse usage when both fields are set, that can cause confusion. We could check in a validation webhook, and given that this field is new, the change is backward compatible.
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.
Sounds good. 👍
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.
Actually, both fields have mandatory defaults. They are always defined. Meaning we cannot differentiate between deliberately set or the default value defined. Which means we cannot have a validation against them.
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.
We could move the defaults in the defaulting webhook instead of openapi schema? That way, the defaulting logic can be conditional.
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.
I'm not a 100% sure how that works. It wouldn't break existing clusters, right? Like, the default in the kubebuilder results in a different yaml, while the defaulting webhook... doesn't? Or does it?
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.
Also... Okay. So... Kubebuilder Markers GENERATE default values so the generated output will be different. But mutating admission webhooks change values in flight so the output OBJECT's value will be different.
Unless I'm super mistaken these two scenarios ARE different.
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.
The yaml is going to be different, although the defaulting logic moves to the webhook, which historically we have not treated as a breaking change, but as a compatible one.
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.
That said, what I was suggesting is to validate this new field in the webhook, and reject it when the other two colliding fields are set.
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.
Yes, but validating it would require removing the defaults from here. And that's what started this conversation. :)
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 that's not a breaking change, @fabriziopandini @sbueringer from the upstream project can keep me honest though.
545ecd3
to
67ad355
Compare
/test pull-cluster-api-provider-aws-e2e |
#4575 is probably needed for the eks e2e to pass. |
67ad355
to
f6ed45c
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/test pull-cluster-api-provider-aws-e2e-eks |
/retest |
/lgtm |
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.
LGTM except one minor remark
AvailabilityZone: aws.String("us-east-1b"), | ||
MapPublicIpOnLaunch: aws.Bool(false), | ||
}, | ||
}, nil).After(zone1PublicSubnet) |
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.
[minor]
Isn't it an implementation detail in which order private and public subnets are created i.e. we shouldn't check for private.After(public)
here?
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.
I don't think it matters that much here? I copied this entire section from previous tests. :) So whatever they do this one does as well. :)
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, not a blocker at all
/lgtm |
Hey ! |
I can rebase and the rest is up to the capa team. :) |
f6ed45c
to
2b8faee
Compare
New changes are detected. LGTM label has been removed. |
Interesting, I ran |
2b8faee
to
c426f23
Compare
The only thing left in this PR is to adjust the webhook validation like mentioned above |
Yeah, not gonna do that. Someone else can pick this up. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
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 #4333
Special notes for your reviewer:
Checklist:
Release note: