From c59627288570f64e4f148bec117c0148db512fc7 Mon Sep 17 00:00:00 2001 From: zbb88888 Date: Wed, 30 Jul 2025 15:57:05 +0800 Subject: [PATCH] vlan subnet vpc is optional Signed-off-by: zbb88888 --- pkg/controller/subnet.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/controller/subnet.go b/pkg/controller/subnet.go index b3834939995..0eeec3e147a 100644 --- a/pkg/controller/subnet.go +++ b/pkg/controller/subnet.go @@ -156,8 +156,9 @@ func (c *Controller) formatSubnet(subnet *kubeovnv1.Subnet) (*kubeovnv1.Subnet, changed = true } - if subnet.Spec.Vpc == "" { - if isOvnSubnet(subnet) { + if subnet.Spec.Vpc == "" && isOvnSubnet(subnet) { + // for better security, if not set, vlan subnet vpc should be empty + if subnet.Spec.Vlan == "" { subnet.Spec.Vpc = c.config.ClusterRouter changed = true }