Add flag to allow setting a shutdown grace period

This commit is contained in:
Björn Carlsson 2020-07-06 21:05:16 +02:00
parent 032fccb292
commit 54b13bd216
6 changed files with 140 additions and 0 deletions

View file

@ -367,6 +367,8 @@ func (n *NGINXController) Stop() error {
return fmt.Errorf("shutdown already in progress")
}
time.Sleep(time.Duration(n.cfg.ShutdownGracePeriod) * time.Second)
klog.InfoS("Shutting down controller queues")
close(n.stopCh)
go n.syncQueue.Shutdown()