-
Notifications
You must be signed in to change notification settings - Fork 640
🐛 add marketType field validation #5374
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,6 +64,8 @@ const ( | |
| ) | ||
|
|
||
| // AWSMachineSpec defines the desired state of an Amazon EC2 instance. | ||
| // +kubebuilder:validation:XValidation:rule="!has(self.capacityReservationId) || !has(self.marketType) || self.marketType != 'Spot'",message="capacityReservationId may not be set when marketType is Spot" | ||
| // +kubebuilder:validation:XValidation:rule="!has(self.capacityReservationId) || !has(self.spotMarketOptions)",message="capacityReservationId cannot be set when spotMarketOptions is specified" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll need to check the docs (but maybe @JoelSpeed knows), if we are tightening the validation rules is this considered a breaking behavioural change? Guess it depends on if it breaks currently. @athiruma - whats the current behaviour if i set
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it will raise an error. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the capacity reservation ID field has already shipped within a release, then yes, this could cause an issue for users who have already started using the field Given that EC2 will reject creating machines with this configuration already, we are bringing the validation earlier here realistically, and ratcheting should also help with invalid combinations if folks are updating the objects. I'm inclined to say this is likely to be fairly safe depending on how long ago this shipped
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It has shipped in CAPA v2.8.1 a couple of weeks ago.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds like we are all good then.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah considering this would already fail anyway at a later stage. |
||
| type AWSMachineSpec struct { | ||
| // ProviderID is the unique identifier as specified by the cloud provider. | ||
| ProviderID *string `json:"providerID,omitempty"` | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.