Skip to content

Commit

Permalink
fix: init ipam before gc, other wise routes will be deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
oilbeater committed May 18, 2020
1 parent 9d093e4 commit b0f0947
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,15 +256,15 @@ func (c *Controller) Run(stopCh <-chan struct{}) {
klog.Fatalf("failed to init ovn resource %v", err)
}

if err := c.InitIPAM(); err != nil {
klog.Fatalf("failed to init ipam %v", err)
}

// remove resources in ovndb that not exist any more in kubernetes resources
if err := c.gc(); err != nil {
klog.Fatalf("gc failed %v", err)
}

if err := c.InitIPAM(); err != nil {
klog.Fatalf("failed to init ipam %v", err)
}

// start workers to do all the network operations
c.startWorkers(stopCh)
<-stopCh
Expand Down

0 comments on commit b0f0947

Please sign in to comment.