-
Notifications
You must be signed in to change notification settings - Fork 566
feat: make Gateway.Spec.Addresses.Value
optional
#3616
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
bcc53c1
e3c5cb6
9b4c8d1
687de42
cc7a71b
afb0490
1d7df0f
35f890d
eb95ca1
d9c6ec1
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 | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -264,7 +264,7 @@ type GatewaySpec struct { | |||||||||||||||||||||||||||
// +kubebuilder:validation:MaxItems=16 | ||||||||||||||||||||||||||||
// +kubebuilder:validation:XValidation:message="IPAddress values must be unique",rule="self.all(a1, a1.type == 'IPAddress' ? self.exists_one(a2, a2.type == a1.type && a2.value == a1.value) : true )" | ||||||||||||||||||||||||||||
// +kubebuilder:validation:XValidation:message="Hostname values must be unique",rule="self.all(a1, a1.type == 'Hostname' ? self.exists_one(a2, a2.type == a1.type && a2.value == a1.value) : true )" | ||||||||||||||||||||||||||||
Addresses []GatewayAddress `json:"addresses,omitempty"` | ||||||||||||||||||||||||||||
Addresses []GatewaySpecAddress `json:"addresses,omitempty"` | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
// Infrastructure defines infrastructure level attributes about this Gateway instance. | ||||||||||||||||||||||||||||
// | ||||||||||||||||||||||||||||
|
@@ -724,24 +724,27 @@ type RouteGroupKind struct { | |||||||||||||||||||||||||||
Kind Kind `json:"kind"` | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
// GatewayAddress describes an address that can be bound to a Gateway. | ||||||||||||||||||||||||||||
// GatewaySpecAddress describes an address that can be bound to a Gateway. | ||||||||||||||||||||||||||||
// | ||||||||||||||||||||||||||||
// +kubebuilder:validation:XValidation:message="Hostname value must only contain valid characters (matching ^(\\*\\.)?[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$)",rule="self.type == 'Hostname' ? self.value.matches(r\"\"\"^(\\*\\.)?[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$\"\"\"): true" | ||||||||||||||||||||||||||||
type GatewayAddress struct { | ||||||||||||||||||||||||||||
type GatewaySpecAddress struct { | ||||||||||||||||||||||||||||
// Type of the address. | ||||||||||||||||||||||||||||
// | ||||||||||||||||||||||||||||
// +optional | ||||||||||||||||||||||||||||
// +kubebuilder:default=IPAddress | ||||||||||||||||||||||||||||
Type *AddressType `json:"type,omitempty"` | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
// Value of the address. The validity of the values will depend | ||||||||||||||||||||||||||||
// on the type and support by the controller. | ||||||||||||||||||||||||||||
// When a value is unspecified, an implementation SHOULD automatically | ||||||||||||||||||||||||||||
// assign an address matching the requested type if possible. | ||||||||||||||||||||||||||||
// | ||||||||||||||||||||||||||||
// If an implementation does not support an empty value, they MUST set the | ||||||||||||||||||||||||||||
// "Programmed" condition in status to False with a reason of "AddressNotAssigned". | ||||||||||||||||||||||||||||
// | ||||||||||||||||||||||||||||
// Examples: `1.2.3.4`, `128::1`, `my-ip-address`. | ||||||||||||||||||||||||||||
// | ||||||||||||||||||||||||||||
// +kubebuilder:validation:MinLength=1 | ||||||||||||||||||||||||||||
// +optional | ||||||||||||||||||||||||||||
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. This needs some more explanation:
This should then guide you to adding some conformance tests for implementations to test against. 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. amazing thanks! 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. +1 to @youngnick's comments, a couple suggestions as a starting point:
gateway-api/apis/v1/gateway_types.go Lines 874 to 886 in d936258
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 think the extra doc requirement here got missed. I'd still like to see some description of what should happen in both cases on this field, if it's supported and not. 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. Thanks for catching this @youngnick! @EyalPazz any chance you can squeeze this in in the next day or two? Really hoping we can fit this into v1.3 if possible, and we'll need to cut a RC pretty soon. |
||||||||||||||||||||||||||||
// +kubebuilder:validation:MaxLength=253 | ||||||||||||||||||||||||||||
Value string `json:"value"` | ||||||||||||||||||||||||||||
Value string `json:"value,omitempty"` | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
// GatewayStatusAddress describes a network address that is bound to a Gateway. | ||||||||||||||||||||||||||||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.