Skip to content

Commit 75209a5

Browse files
committed
perf: only enqueue subnet when necessary
Signed-off-by: Mengxin Liu <liumengxinfly@gmail.com>
1 parent 15c7c79 commit 75209a5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/controller/vpc.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,11 @@ func (c *Controller) handleAddOrUpdateVpc(key string) error {
594594
custVpcEnableExternalEcmp := false
595595
for _, subnet := range subnets {
596596
if subnet.Spec.Vpc == key {
597-
c.addOrUpdateSubnetQueue.Add(subnet.Name)
597+
// Accelerate subnet update when vpc config is updated.
598+
// In case VPC not set namespaces, subnet will backoff and may take long time to back to ready.
599+
if subnet.Status.IsNotReady() || subnet.Spec.U2OInterconnection {
600+
c.addOrUpdateSubnetQueue.Add(subnet.Name)
601+
}
598602
if vpc.Name != util.DefaultVpc && vpc.Spec.EnableBfd && subnet.Spec.EnableEcmp {
599603
custVpcEnableExternalEcmp = true
600604
}

0 commit comments

Comments
 (0)