Skip to content

Commit

Permalink
fix re-annotate namespaces when subnet deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
oilbeater committed Nov 18, 2019
1 parent 33c95ed commit ac53715
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions pkg/controller/subnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,22 @@ func (c *Controller) handleDeleteSubnet(key string) error {
return err
}

nss, err := c.namespacesLister.List(labels.Everything())
if err != nil {
klog.Errorf("failed to list namespaces, %v", err)
return err
}

// re-annotate namespace
for _, ns := range nss {
annotations := ns.GetAnnotations()
if annotations == nil {
continue
}
if annotations[util.LogicalSwitchAnnotation] == key {
c.enqueueAddNamespace(ns)
}
}
return nil
}

Expand Down

0 comments on commit ac53715

Please sign in to comment.