Skip to content

Commit 905b541

Browse files
authored
add subnetstatus lock for handleAddOrUpdateSubnet (#2668)
1 parent abed471 commit 905b541

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/controller/subnet.go

+3
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,9 @@ func (c Controller) patchSubnetStatus(subnet *kubeovnv1.Subnet, reason string, e
433433

434434
func (c *Controller) handleAddOrUpdateSubnet(key string) error {
435435
var err error
436+
c.subnetStatusKeyMutex.Lock(key)
437+
defer c.subnetStatusKeyMutex.Unlock(key)
438+
436439
cachedSubnet, err := c.subnetsLister.Get(key)
437440
if err != nil {
438441
if k8serrors.IsNotFound(err) {

0 commit comments

Comments
 (0)