Skip to content

Commit

Permalink
fix: prevent update failed logs
Browse files Browse the repository at this point in the history
  • Loading branch information
oilbeater committed Aug 8, 2020
1 parent 6e2e4aa commit c9d07e1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ func (c *Controller) startWorkers(stopCh <-chan struct{}) {

// add default/join subnet and wait them ready
go wait.Until(c.runAddSubnetWorker, time.Second, stopCh)
go wait.Until(c.runAddVlanWorker, time.Second, stopCh)
for {
klog.Infof("wait for %s and %s ready", c.config.DefaultLogicalSwitch, c.config.NodeSwitch)
time.Sleep(3 * time.Second)
Expand Down Expand Up @@ -370,7 +371,6 @@ func (c *Controller) startWorkers(stopCh <-chan struct{}) {
go wait.Until(c.runUpdateNpWorker, time.Second, stopCh)
go wait.Until(c.runDeleteNpWorker, time.Second, stopCh)

go wait.Until(c.runAddVlanWorker, time.Second, stopCh)
go wait.Until(c.runDelVlanWorker, time.Second, stopCh)
go wait.Until(c.runUpdateVlanWorker, time.Second, stopCh)
}
Expand Down
8 changes: 8 additions & 0 deletions pkg/controller/subnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,14 @@ func (c *Controller) handleAddOrUpdateSubnet(key string) error {
return nil
}

subnet, err = c.subnetsLister.Get(key)
if err != nil {
if k8serrors.IsNotFound(err) {
return nil
}
return err
}

if err := formatSubnet(subnet, c); err != nil {
return err
}
Expand Down

0 comments on commit c9d07e1

Please sign in to comment.