Skip to content

Commit 9a6a6ad

Browse files
committed
adjust markers
1 parent 887358c commit 9a6a6ad

File tree

7 files changed

+23
-9
lines changed

7 files changed

+23
-9
lines changed

apis/v1/gateway_types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,9 @@ type Listener struct {
390390
// same port, subject to the Listener compatibility rules.
391391
//
392392
// Support: Core
393+
//
394+
// +kubebuilder:validation:Minimum=1
395+
// +kubebuilder:validation:Maximum=65535
393396
Port PortNumber `json:"port"`
394397

395398
// Protocol specifies the network protocol this listener expects to receive.

apis/v1/httproute_types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,6 +1209,9 @@ type HTTPRequestRedirectFilter struct {
12091209
// Support: Extended
12101210
//
12111211
// +optional
1212+
//
1213+
// +kubebuilder:validation:Minimum=1
1214+
// +kubebuilder:validation:Maximum=65535
12121215
Port *PortNumber `json:"port,omitempty"`
12131216

12141217
// StatusCode is the HTTP status code to be used in response.

apis/v1/object_reference_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ type BackendObjectReference struct {
143143
// resource or this field.
144144
//
145145
// +optional
146+
// +kubebuilder:validation:Minimum=1
147+
// +kubebuilder:validation:Maximum=65535
146148
Port *PortNumber `json:"port,omitempty"`
147149
}
148150

apis/v1/shared_types.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,9 @@ type ParentReference struct {
148148
// Support: Extended
149149
//
150150
// +optional
151+
//
152+
// +kubebuilder:validation:Minimum=1
153+
// +kubebuilder:validation:Maximum=65535
151154
Port *PortNumber `json:"port,omitempty"`
152155
}
153156

@@ -227,9 +230,6 @@ type CommonRouteSpec struct {
227230
}
228231

229232
// PortNumber defines a network port.
230-
//
231-
// +kubebuilder:validation:Minimum=1
232-
// +kubebuilder:validation:Maximum=65535
233233
type PortNumber int32
234234

235235
// BackendRef defines how a Route should forward a request to a Kubernetes

apis/v1alpha2/shared_types.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ type ParentReference = v1.ParentReference
4040
type CommonRouteSpec = v1.CommonRouteSpec
4141

4242
// PortNumber defines a network port.
43-
//
44-
// +kubebuilder:validation:Minimum=1
45-
// +kubebuilder:validation:Maximum=65535
4643
type PortNumber = v1.PortNumber
4744

4845
// BackendRef defines how a Route should forward a request to a Kubernetes

apis/v1beta1/shared_types.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ type ParentReference = v1.ParentReference
4040
type CommonRouteSpec = v1.CommonRouteSpec
4141

4242
// PortNumber defines a network port.
43-
//
44-
// +kubebuilder:validation:Minimum=1
45-
// +kubebuilder:validation:Maximum=65535
4643
type PortNumber = v1.PortNumber
4744

4845
// BackendRef defines how a Route should forward a request to a Kubernetes

apisx/v1alpha1/xlistenerset_types.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,16 @@ type ListenerEntry struct {
128128
// Port is the network port. Multiple listeners may use the
129129
// same port, subject to the Listener compatibility rules.
130130
//
131+
// If the port is not set or specified as zero, the implementation will assign
132+
// a unique port. If the implementation does not support dynamic port
133+
// assignment, it MUST set `Accepted` condition to `False` with the
134+
// `UnsupportedPort` reason.
135+
//
131136
// +optional
137+
//
138+
// +kubebuilder:default=0
139+
// +kubebuilder:validation:Minimum=0
140+
// +kubebuilder:validation:Maximum=65535
132141
Port PortNumber `json:"port,omitempty"`
133142

134143
// Protocol specifies the network protocol this listener expects to receive.
@@ -210,6 +219,9 @@ type ListenerEntryStatus struct {
210219
Name SectionName `json:"name"`
211220

212221
// Port is the network port the listener is configured to listen on.
222+
//
223+
// +kubebuilder:validation:Minimum=1
224+
// +kubebuilder:validation:Maximum=65535
213225
Port PortNumber `json:"port"`
214226

215227
// SupportedKinds is the list indicating the Kinds supported by this

0 commit comments

Comments
 (0)