Skip to content

Commit

Permalink
Ensure we cleanup cableengine resources
Browse files Browse the repository at this point in the history
With the OVN-K CNI we were seeing and ungraceful
termination of the GW Pod in GW migration tests,
this patch ensures we cleanup the cableengine
on node resources before exiting.

Signed-off-by: Andrew Stoycos <astoycos@redhat.com>
  • Loading branch information
astoycos committed May 12, 2022
1 parent b6c7d40 commit e28ed6c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const (

var VERSION = "not-compiled-properly"

func main() {
func main() { // nolint:gocyclo // This function is complicated
klog.InitFlags(nil)
flag.Parse()

Expand Down Expand Up @@ -252,6 +252,11 @@ func main() {
}()

<-stopCh

if err := cableEngine.Cleanup(); err != nil {
klog.Errorf("error cleaning up cableEngine resources before removing Gateway")
}

klog.Info("All controllers stopped or exited. Stopping main loop")

if err := httpServer.Shutdown(context.TODO()); err != nil {
Expand Down

0 comments on commit e28ed6c

Please sign in to comment.