Skip to content

Commit

Permalink
implemented check for vni maximum
Browse files Browse the repository at this point in the history
  • Loading branch information
Haven456 committed Mar 19, 2024
1 parent bfdc62a commit 63d1f4d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ spec:
vni:
description: VXLAN VNI Id for the layer 2 network
minimum: 1
maximum: 16777215
type: integer
vrf:
description: VRF to attach Layer2 network to, default if not set
Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/layer3.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func (r *reconcile) createVrfConfigMap(l3vnis []networkv1alpha1.VRFRouteConfigur
continue
}

if vni == 0 {
if vni > 0 && vni < 16777215 {
err := fmt.Errorf("VNI can not be set to 0")
r.Logger.Error(err, "VNI can not be set to 0, ignoring", "vrf", spec.VRF, "name", l3vnis[i].ObjectMeta.Name, "namespace", l3vnis[i].ObjectMeta.Namespace)
continue
Expand Down

0 comments on commit 63d1f4d

Please sign in to comment.