Commit 9728c56a authored by Yu-Ju Hong's avatar Yu-Ju Hong

dockershim: call DockerService.Start() during grpc server startup

parent 20910289
...@@ -998,10 +998,6 @@ func RunDockershim(f *options.KubeletFlags, c *kubeletconfiginternal.KubeletConf ...@@ -998,10 +998,6 @@ func RunDockershim(f *options.KubeletFlags, c *kubeletconfiginternal.KubeletConf
if err != nil { if err != nil {
return err return err
} }
if err := ds.Start(); err != nil {
return err
}
glog.V(2).Infof("Starting the GRPC server for the docker CRI shim.") glog.V(2).Infof("Starting the GRPC server for the docker CRI shim.")
server := dockerremote.NewDockerServer(f.RemoteRuntimeEndpoint, ds) server := dockerremote.NewDockerServer(f.RemoteRuntimeEndpoint, ds)
if err := server.Start(); err != nil { if err := server.Start(); err != nil {
......
...@@ -266,6 +266,8 @@ func NewDockerService(config *ClientConfig, podSandboxImage string, streamingCon ...@@ -266,6 +266,8 @@ func NewDockerService(config *ClientConfig, podSandboxImage string, streamingCon
type CRIService interface { type CRIService interface {
runtimeapi.RuntimeServiceServer runtimeapi.RuntimeServiceServer
runtimeapi.ImageServiceServer runtimeapi.ImageServiceServer
Start() error
} }
// DockerService is an interface that embeds the new RuntimeService and // DockerService is an interface that embeds the new RuntimeService and
...@@ -273,7 +275,6 @@ type CRIService interface { ...@@ -273,7 +275,6 @@ type CRIService interface {
type DockerService interface { type DockerService interface {
CRIService CRIService
Start() error
// For serving streaming calls. // For serving streaming calls.
http.Handler http.Handler
......
...@@ -48,6 +48,12 @@ func NewDockerServer(endpoint string, s dockershim.CRIService) *DockerServer { ...@@ -48,6 +48,12 @@ func NewDockerServer(endpoint string, s dockershim.CRIService) *DockerServer {
// Start starts the dockershim grpc server. // Start starts the dockershim grpc server.
func (s *DockerServer) Start() error { func (s *DockerServer) Start() error {
// Start the internal service.
if err := s.service.Start(); err != nil {
glog.Errorf("Unable to start docker service")
return err
}
glog.V(2).Infof("Start dockershim grpc server") glog.V(2).Infof("Start dockershim grpc server")
l, err := util.CreateListener(s.endpoint) l, err := util.CreateListener(s.endpoint)
if err != nil { if err != nil {
......
...@@ -610,9 +610,6 @@ func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration, ...@@ -610,9 +610,6 @@ func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration,
if err != nil { if err != nil {
return nil, err return nil, err
} }
if err := ds.Start(); err != nil {
return nil, err
}
// For now, the CRI shim redirects the streaming requests to the // For now, the CRI shim redirects the streaming requests to the
// kubelet, which handles the requests using DockerService.. // kubelet, which handles the requests using DockerService..
klet.criHandler = ds klet.criHandler = ds
......
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