Skip to content

Commit 7b1dd05

Browse files
committed
fix: add description for vlan interfaces
Signed-off-by: Mengxin Liu <liumengxinfly@gmail.com>
1 parent e80849e commit 7b1dd05

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

charts/kube-ovn-v2/crds/kube-ovn-crd.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3025,13 +3025,15 @@ spec:
30253025
type: string
30263026
autoCreateVlanSubinterfaces:
30273027
type: boolean
3028+
description: Enable automatic detection and preservation of VLAN interfaces
30283029
preserveVlanInterfaces:
30293030
type: boolean
30303031
vlanInterfaces:
30313032
type: array
30323033
items:
30333034
type: string
30343035
pattern: '^[a-zA-Z0-9_-]+\.[0-9]{1,4}$'
3036+
description: Optional explicit list of VLAN interface names to preserve (e.g., eth0.10, bond0.20)
30353037
required:
30363038
- defaultInterface
30373039
status:

charts/kube-ovn/templates/kube-ovn-crd.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3027,11 +3027,13 @@ spec:
30273027
type: boolean
30283028
preserveVlanInterfaces:
30293029
type: boolean
3030+
description: Enable automatic detection and preservation of VLAN interfaces
30303031
vlanInterfaces:
30313032
type: array
30323033
items:
30333034
type: string
30343035
pattern: '^[a-zA-Z0-9_-]+\.[0-9]{1,4}$'
3036+
description: Optional explicit list of VLAN interface names to preserve (e.g., eth0.10, bond0.20)
30353037
required:
30363038
- defaultInterface
30373039
status:

dist/images/install.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3275,6 +3275,15 @@ spec:
32753275
type: string
32763276
autoCreateVlanSubinterfaces:
32773277
type: boolean
3278+
preserveVlanInterfaces:
3279+
type: boolean
3280+
description: Enable automatic detection and preservation of VLAN interfaces
3281+
vlanInterfaces:
3282+
type: array
3283+
items:
3284+
type: string
3285+
pattern: '^[a-zA-Z0-9_-]+\.[0-9]{1,4}$'
3286+
description: Optional explicit list of VLAN interface names to preserve (e.g., eth0.10, bond0.20)
32783287
required:
32793288
- defaultInterface
32803289
status:

pkg/daemon/controller.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,7 @@ func (c *Controller) initProviderNetwork(pn *kubeovnv1.ProviderNetwork, node *v1
421421
klog.Infof("Processing %d explicitly specified VLAN interfaces", len(pn.Spec.VlanInterfaces))
422422
for _, vlanIfName := range pn.Spec.VlanInterfaces {
423423
if util.CheckInterfaceExists(vlanIfName) {
424+
// Extract VLAN ID from interface name (e.g., "eth0.10" -> 10)
424425
vlanID, err := util.ExtractVlanIDFromInterface(vlanIfName)
425426
if err != nil {
426427
klog.Warningf("Failed to extract VLAN ID from interface %s: %v", vlanIfName, err)
@@ -441,6 +442,7 @@ func (c *Controller) initProviderNetwork(pn *kubeovnv1.ProviderNetwork, node *v1
441442
vlanIDs := util.DetectVlanInterfaces(nic)
442443
for _, vlanID := range vlanIDs {
443444
vlanIfName := fmt.Sprintf("%s.%d", nic, vlanID)
445+
// Only add if not already explicitly specified
444446
if _, exists := vlanInterfaceMap[vlanIfName]; !exists {
445447
vlanInterfaceMap[vlanIfName] = vlanID
446448
vlans.Add(strconv.Itoa(vlanID))

0 commit comments

Comments
 (0)