Skip to content

Commit

Permalink
fix: re-check ns annotation to avoid annotations lost
Browse files Browse the repository at this point in the history
  • Loading branch information
oilbeater committed Sep 14, 2021
1 parent 1940acf commit c71620c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/controller/namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ func (c *Controller) enqueueUpdateNamespace(old, new interface{}) {
c.updateNpQueue.Add(np)
}
}

// in case annotations are removed by other controllers
if newNs.Annotations == nil || newNs.Annotations[util.LogicalSwitchAnnotation] == "" {
klog.Warningf("no logical switch annotation for ns %s", newNs.Name)
c.addNamespaceQueue.Add(newNs.Name)
}
}

func (c *Controller) runAddNamespaceWorker() {
Expand Down

0 comments on commit c71620c

Please sign in to comment.