Skip to content

Commit 6985ae0

Browse files
author
Andrew Lee
committed
We've seen instances of a VPC being left with a now-deleted subnet on
its status field. We believe this is due to a race condition where we patch a VPC without taking care of ResourceVersion. For now, every time we run `handleAddOrUpdateVpc` we ensure the vpc.Status.Subnets field is correct. Fixes: #5220 Signed-off-by: Andrew Lee <alee@evroc.com>
1 parent 490ecc0 commit 6985ae0

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

pkg/controller/vpc.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,14 @@ func (c *Controller) handleAddOrUpdateVpc(key string) error {
492492
}
493493
}
494494

495+
vpcSubnets, defaultSubnet, err := c.getVpcSubnets(vpc)
496+
if err != nil {
497+
klog.Error(err)
498+
return err
499+
}
500+
501+
vpc.Status.Subnets = vpcSubnets
502+
vpc.Status.DefaultLogicalSwitch = defaultSubnet
495503
vpc.Status.Router = key
496504
vpc.Status.Standby = true
497505
vpc.Status.VpcPeerings = newPeers

0 commit comments

Comments
 (0)