Skip to content

Commit 94a5ae2

Browse files
KennethHolmSeeligKenneth Holm Seelig
andauthored
MINOR: Remove duplicate rules to avoid validation warning when applying (ionos-cloud#559)
* MINOR: Remove duplicate rules to avoid validation warning when applying * optional fix for duplicate validation rule * +optional validation should not be on type level, but field --------- Co-authored-by: Kenneth Holm Seelig <[email protected]>
1 parent 4a59812 commit 94a5ae2

5 files changed

+2
-31
lines changed

api/v1alpha1/proxmoxmachine_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ type InterfaceConfig struct {
298298

299299
// LinkMTU is the network device Maximum Transmission Unit.
300300
// +optional
301+
// +kubebuilder:validation:XValidation:rule="self == 1 || ( self >= 576 && self <= 65520)",message="invalid MTU value"
301302
LinkMTU MTU `json:"linkMtu,omitempty"`
302303
}
303304

@@ -395,6 +396,7 @@ type NetworkDevice struct {
395396
// MTU is the network device Maximum Transmission Unit.
396397
// When set to 1, virtio devices inherit the MTU value from the underlying bridge.
397398
// +optional
399+
// +kubebuilder:validation:XValidation:rule="self == 1 || ( self >= 576 && self <= 65520)",message="invalid MTU value"
398400
MTU MTU `json:"mtu,omitempty"`
399401

400402
// VLAN is the network L2 VLAN.
@@ -418,8 +420,6 @@ type NetworkDevice struct {
418420
}
419421

420422
// MTU is the network device Maximum Transmission Unit. MTUs below 1280 break IPv6.
421-
// +optional
422-
// +kubebuilder:validation:XValidation:rule="self == 1 || ( self >= 576 && self <= 65520)",message="invalid MTU value"
423423
type MTU *uint16
424424

425425
// AdditionalNetworkDevice the definition of a Proxmox network device.

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,6 @@ spec:
264264
- message: invalid MTU value
265265
rule: self == 1 || ( self >= 576 && self <=
266266
65520)
267-
- message: invalid MTU value
268-
rule: self == 1 || ( self >= 576 && self <=
269-
65520)
270267
model:
271268
default: virtio
272269
description: Model is the network device model.
@@ -285,9 +282,6 @@ spec:
285282
- message: invalid MTU value
286283
rule: self == 1 || ( self >= 576 && self <=
287284
65520)
288-
- message: invalid MTU value
289-
rule: self == 1 || ( self >= 576 && self <=
290-
65520)
291285
name:
292286
description: |-
293287
Name is the network device name.
@@ -478,8 +472,6 @@ spec:
478472
x-kubernetes-validations:
479473
- message: invalid MTU value
480474
rule: self == 1 || ( self >= 576 && self <= 65520)
481-
- message: invalid MTU value
482-
rule: self == 1 || ( self >= 576 && self <= 65520)
483475
vlan:
484476
description: VLAN is the network L2 VLAN.
485477
maximum: 4094

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -288,9 +288,6 @@ spec:
288288
- message: invalid MTU value
289289
rule: self == 1 || ( self >= 576 &&
290290
self <= 65520)
291-
- message: invalid MTU value
292-
rule: self == 1 || ( self >= 576 &&
293-
self <= 65520)
294291
model:
295292
default: virtio
296293
description: Model is the network device
@@ -310,9 +307,6 @@ spec:
310307
- message: invalid MTU value
311308
rule: self == 1 || ( self >= 576 &&
312309
self <= 65520)
313-
- message: invalid MTU value
314-
rule: self == 1 || ( self >= 576 &&
315-
self <= 65520)
316310
name:
317311
description: |-
318312
Name is the network device name.
@@ -510,9 +504,6 @@ spec:
510504
- message: invalid MTU value
511505
rule: self == 1 || ( self >= 576 && self
512506
<= 65520)
513-
- message: invalid MTU value
514-
rule: self == 1 || ( self >= 576 && self
515-
<= 65520)
516507
vlan:
517508
description: VLAN is the network L2 VLAN.
518509
maximum: 4094

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,6 @@ spec:
246246
x-kubernetes-validations:
247247
- message: invalid MTU value
248248
rule: self == 1 || ( self >= 576 && self <= 65520)
249-
- message: invalid MTU value
250-
rule: self == 1 || ( self >= 576 && self <= 65520)
251249
model:
252250
default: virtio
253251
description: Model is the network device model.
@@ -265,8 +263,6 @@ spec:
265263
x-kubernetes-validations:
266264
- message: invalid MTU value
267265
rule: self == 1 || ( self >= 576 && self <= 65520)
268-
- message: invalid MTU value
269-
rule: self == 1 || ( self >= 576 && self <= 65520)
270266
name:
271267
description: |-
272268
Name is the network device name.
@@ -441,8 +437,6 @@ spec:
441437
x-kubernetes-validations:
442438
- message: invalid MTU value
443439
rule: self == 1 || ( self >= 576 && self <= 65520)
444-
- message: invalid MTU value
445-
rule: self == 1 || ( self >= 576 && self <= 65520)
446440
vlan:
447441
description: VLAN is the network L2 VLAN.
448442
maximum: 4094

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,6 @@ spec:
267267
x-kubernetes-validations:
268268
- message: invalid MTU value
269269
rule: self == 1 || ( self >= 576 && self <= 65520)
270-
- message: invalid MTU value
271-
rule: self == 1 || ( self >= 576 && self <= 65520)
272270
model:
273271
default: virtio
274272
description: Model is the network device model.
@@ -286,8 +284,6 @@ spec:
286284
x-kubernetes-validations:
287285
- message: invalid MTU value
288286
rule: self == 1 || ( self >= 576 && self <= 65520)
289-
- message: invalid MTU value
290-
rule: self == 1 || ( self >= 576 && self <= 65520)
291287
name:
292288
description: |-
293289
Name is the network device name.
@@ -476,8 +472,6 @@ spec:
476472
x-kubernetes-validations:
477473
- message: invalid MTU value
478474
rule: self == 1 || ( self >= 576 && self <= 65520)
479-
- message: invalid MTU value
480-
rule: self == 1 || ( self >= 576 && self <= 65520)
481475
vlan:
482476
description: VLAN is the network L2 VLAN.
483477
maximum: 4094

0 commit comments

Comments
 (0)