Skip to content

Commit d265963

Browse files
feat: Add minimum value for MTU to be 1300 and maximum to be 8896
1 parent 78a8390 commit d265963

File tree

4 files changed

+28
-12
lines changed

4 files changed

+28
-12
lines changed

api/v1beta1/types.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,13 @@ type NetworkSpec struct {
137137
// +optional
138138
HostProject *string `json:"hostProject,omitempty"`
139139

140-
// Mtu: Maximum Transmission Unit (MTU), in bytes, of packets passing through
141-
// this interconnect attachment. Only 1440 and 1500 are allowed. If not
142-
// specified, the value will default to 1440.
140+
// Mtu: Maximum Transmission Unit in bytes. The minimum value for this field is
141+
// 1300 and the maximum value is 8896. The suggested value is 1500, which is
142+
// the default MTU used on the Internet, or 8896 if you want to use Jumbo
143+
// frames. If unspecified, the value defaults to 1460.
144+
// More info: https://pkg.go.dev/google.golang.org/api/compute/v1#Network
145+
// +kubebuilder:validation:Minimum:=1300
146+
// +kubebuilder:validation:Maximum:=8896
143147
// +optional
144148
Mtu int64 `json:"mtu,omitempty"`
145149
}

config/crd/bases/infrastructure.cluster.x-k8s.io_gcpclusters.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,14 @@ spec:
170170
type: integer
171171
mtu:
172172
description: |-
173-
Mtu: Maximum Transmission Unit (MTU), in bytes, of packets passing through
174-
this interconnect attachment. Only 1440 and 1500 are allowed. If not
175-
specified, the value will default to 1440.
173+
Mtu: Maximum Transmission Unit in bytes. The minimum value for this field is
174+
1300 and the maximum value is 8896. The suggested value is 1500, which is
175+
the default MTU used on the Internet, or 8896 if you want to use Jumbo
176+
frames. If unspecified, the value defaults to 1460.
177+
More info: https://pkg.go.dev/google.golang.org/api/compute/v1#Network
176178
format: int64
179+
maximum: 8896
180+
minimum: 1300
177181
type: integer
178182
name:
179183
description: Name is the name of the network to be used.

config/crd/bases/infrastructure.cluster.x-k8s.io_gcpclustertemplates.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,14 @@ spec:
187187
type: integer
188188
mtu:
189189
description: |-
190-
Mtu: Maximum Transmission Unit (MTU), in bytes, of packets passing through
191-
this interconnect attachment. Only 1440 and 1500 are allowed. If not
192-
specified, the value will default to 1440.
190+
Mtu: Maximum Transmission Unit in bytes. The minimum value for this field is
191+
1300 and the maximum value is 8896. The suggested value is 1500, which is
192+
the default MTU used on the Internet, or 8896 if you want to use Jumbo
193+
frames. If unspecified, the value defaults to 1460.
194+
More info: https://pkg.go.dev/google.golang.org/api/compute/v1#Network
193195
format: int64
196+
maximum: 8896
197+
minimum: 1300
194198
type: integer
195199
name:
196200
description: Name is the name of the network to be used.

config/crd/bases/infrastructure.cluster.x-k8s.io_gcpmanagedclusters.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,14 @@ spec:
166166
type: integer
167167
mtu:
168168
description: |-
169-
Mtu: Maximum Transmission Unit (MTU), in bytes, of packets passing through
170-
this interconnect attachment. Only 1440 and 1500 are allowed. If not
171-
specified, the value will default to 1440.
169+
Mtu: Maximum Transmission Unit in bytes. The minimum value for this field is
170+
1300 and the maximum value is 8896. The suggested value is 1500, which is
171+
the default MTU used on the Internet, or 8896 if you want to use Jumbo
172+
frames. If unspecified, the value defaults to 1460.
173+
More info: https://pkg.go.dev/google.golang.org/api/compute/v1#Network
172174
format: int64
175+
maximum: 8896
176+
minimum: 1300
173177
type: integer
174178
name:
175179
description: Name is the name of the network to be used.

0 commit comments

Comments
 (0)