Commit de6d2da9 authored by Darren Shepherd's avatar Darren Shepherd

Add back stopCh to cmd apis

parent 819d99b8
......@@ -23,6 +23,7 @@ import (
"errors"
goflag "flag"
"fmt"
"k8s.io/apiserver/pkg/server"
"math/rand"
"os"
"path"
......@@ -85,12 +86,14 @@ func commandFor(basename string, defaultCommand *cobra.Command, commands []func(
func NewHyperKubeCommand() (*cobra.Command, []func() *cobra.Command) {
// these have to be functions since the command is polymorphic. Cobra wants you to be top level
// command to get executed
apiserver := func() *cobra.Command { return kubeapiserver.NewAPIServerCommand() }
stopCh := server.SetupSignalHandler()
apiserver := func() *cobra.Command { return kubeapiserver.NewAPIServerCommand(stopCh) }
controller := func() *cobra.Command { return kubecontrollermanager.NewControllerManagerCommand() }
proxy := func() *cobra.Command { return kubeproxy.NewProxyCommand() }
scheduler := func() *cobra.Command { return kubescheduler.NewSchedulerCommand() }
kubectlCmd := func() *cobra.Command { return kubectl.NewDefaultKubectlCommand() }
kubelet := func() *cobra.Command { return kubelet.NewKubeletCommand() }
kubelet := func() *cobra.Command { return kubelet.NewKubeletCommand(stopCh) }
commandFns := []func() *cobra.Command{
apiserver,
......
......@@ -92,7 +92,7 @@ const (
)
// NewAPIServerCommand creates a *cobra.Command object with default parameters
func NewAPIServerCommand() *cobra.Command {
func NewAPIServerCommand(stopCh <-chan struct{}) *cobra.Command {
s := options.NewServerRunOptions()
cmd := &cobra.Command{
Use: "kube-apiserver",
......@@ -115,7 +115,7 @@ cluster's shared state through which all other components interact.`,
return utilerrors.NewAggregate(errs)
}
return Run(completedOptions, genericapiserver.SetupSignalHandler())
return Run(completedOptions, stopCh)
},
}
......
......@@ -46,7 +46,6 @@ import (
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apimachinery/pkg/util/wait"
genericapiserver "k8s.io/apiserver/pkg/server"
"k8s.io/apiserver/pkg/server/healthz"
utilfeature "k8s.io/apiserver/pkg/util/feature"
clientset "k8s.io/client-go/kubernetes"
......@@ -110,7 +109,7 @@ const (
)
// NewKubeletCommand creates a *cobra.Command object with default parameters
func NewKubeletCommand() *cobra.Command {
func NewKubeletCommand(stopCh <-chan struct{}) *cobra.Command {
cleanFlagSet := pflag.NewFlagSet(componentKubelet, pflag.ContinueOnError)
cleanFlagSet.SetNormalizeFunc(cliflag.WordSepNormalizeFunc)
kubeletFlags := options.NewKubeletFlags()
......@@ -256,9 +255,6 @@ HTTP server: The kubelet can also listen for HTTP and respond to a simple API
// add the kubelet config controller to kubeletDeps
kubeletDeps.KubeletConfigController = kubeletConfigController
// set up stopCh here in order to be reused by kubelet and docker shim
stopCh := genericapiserver.SetupSignalHandler()
// start the experimental docker shim, if enabled
if kubeletServer.KubeletFlags.ExperimentalDockershim {
if err := RunDockershim(&kubeletServer.KubeletFlags, kubeletConfig, stopCh); err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment