Skip to content

Commit

Permalink
fix: stop ovn-ic when disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
oilbeater committed Sep 3, 2020
1 parent 363d471 commit 115c126
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pkg/controller/ovn-ic.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ func (c *Controller) removeInterConnection(config map[string]string) error {
return err
}

if err := c.stopOVNIC(); err != nil {
klog.Errorf("failed to stop ovn-ic, %v", err)
return err
}

return nil
}

Expand Down Expand Up @@ -207,6 +212,15 @@ func (c *Controller) startOVNIC(icHost, icNbPort, icSbPort string) error {
return nil
}

func (c *Controller) stopOVNIC() error {
cmd := exec.Command("/usr/share/ovn/scripts/ovn-ctl", "stop_ic")
output, err := cmd.CombinedOutput()
if err != nil {
return fmt.Errorf("%s", output)
}
return nil
}

func (c *Controller) waitTsReady() error {
retry := 6
for retry > 0 {
Expand Down

0 comments on commit 115c126

Please sign in to comment.