apiservers: add synchronous shutdown mechanism on SIGTERM+INT

This commit is contained in:
Dr. Stefan Schimanski
2017-08-10 10:34:25 +02:00
parent 3537f8fa34
commit 11b25366bc
34 changed files with 324 additions and 66 deletions

View File

@@ -26,7 +26,7 @@ import (
"github.com/spf13/pflag"
)
type serverRunFunc func(s *Server, args []string) error
type serverRunFunc func(s *Server, args []string, stopCh <-chan struct{}) error
// Server describes a server that this binary can morph into.
type Server struct {
@@ -34,6 +34,7 @@ type Server struct {
Long string // Longer free form description of the server
Run serverRunFunc // Run the server. This is not expected to return.
AlternativeName string
RespectsStopCh bool
flags *pflag.FlagSet // Flags for the command (and all dependents)
name string