Skip to content

Commit ec06bde

Browse files
Default list of allowed vlans switchport interfaces to all VLANs
This change removes the requirement for `Interface` resources that are configured as switchports (L2) to specify their list of allowed vlans (trunk vlans). If unset, the configuration should default to allow all VLANs (1-4094) on the particular link.
1 parent cf916b3 commit ec06bde

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

api/core/v1alpha1/interface_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ const (
117117
// Switchport defines the switchport configuration for an interface.
118118
// +kubebuilder:validation:XValidation:rule="self.mode != 'Access' || has(self.accessVlan)", message="accessVlan must be specified when mode is Access"
119119
// +kubebuilder:validation:XValidation:rule="self.mode != 'Trunk' || has(self.nativeVlan)", message="nativeVlan must be specified when mode is Trunk"
120-
// +kubebuilder:validation:XValidation:rule="self.mode != 'Trunk' || has(self.allowedVlans)", message="allowedVlans must be specified when mode is Trunk"
121120
type Switchport struct {
122121
// Mode defines the switchport mode, such as access or trunk.
123122
// +required
@@ -138,6 +137,7 @@ type Switchport struct {
138137
NativeVlan int32 `json:"nativeVlan,omitempty"`
139138

140139
// AllowedVlans is a list of VLAN IDs that are allowed on the trunk port.
140+
// If not specified, all VLANs (1-4094) are allowed.
141141
// Only applicable when Mode is set to "Trunk".
142142
// +optional
143143
// +kubebuilder:validation:MinItems=1

charts/network-operator/templates/crd/networking.metal.ironcore.dev_interfaces.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ spec:
294294
allowedVlans:
295295
description: |-
296296
AllowedVlans is a list of VLAN IDs that are allowed on the trunk port.
297+
If not specified, all VLANs (1-4094) are allowed.
297298
Only applicable when Mode is set to "Trunk".
298299
items:
299300
format: int32
@@ -325,8 +326,6 @@ spec:
325326
rule: self.mode != 'Access' || has(self.accessVlan)
326327
- message: nativeVlan must be specified when mode is Trunk
327328
rule: self.mode != 'Trunk' || has(self.nativeVlan)
328-
- message: allowedVlans must be specified when mode is Trunk
329-
rule: self.mode != 'Trunk' || has(self.allowedVlans)
330329
type:
331330
description: Type indicates the type of the interface.
332331
enum:

config/crd/bases/networking.metal.ironcore.dev_interfaces.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ spec:
288288
allowedVlans:
289289
description: |-
290290
AllowedVlans is a list of VLAN IDs that are allowed on the trunk port.
291+
If not specified, all VLANs (1-4094) are allowed.
291292
Only applicable when Mode is set to "Trunk".
292293
items:
293294
format: int32
@@ -319,8 +320,6 @@ spec:
319320
rule: self.mode != 'Access' || has(self.accessVlan)
320321
- message: nativeVlan must be specified when mode is Trunk
321322
rule: self.mode != 'Trunk' || has(self.nativeVlan)
322-
- message: allowedVlans must be specified when mode is Trunk
323-
rule: self.mode != 'Trunk' || has(self.allowedVlans)
324323
type:
325324
description: Type indicates the type of the interface.
326325
enum:

0 commit comments

Comments
 (0)