Merge pull request #1187 from alculquicondor/feature/tcp

Add option to register on TCP server
This commit is contained in:
Mike Brown
2019-07-25 16:36:05 -05:00
committed by GitHub
3 changed files with 23 additions and 3 deletions

View File

@@ -171,9 +171,15 @@ func NewCRIService(config criconfig.Config, client *containerd.Client) (CRIServi
// Register registers all required services onto a specific grpc server.
// This is used by containerd cri plugin.
func (c *criService) Register(s *grpc.Server) error {
instrumented := newInstrumentedService(c)
runtime.RegisterRuntimeServiceServer(s, instrumented)
runtime.RegisterImageServiceServer(s, instrumented)
return c.register(s)
}
// RegisterTCP register all required services onto a GRPC server on TCP.
// This is used by containerd CRI plugin.
func (c *criService) RegisterTCP(s *grpc.Server) error {
if !c.config.DisableTCPService {
return c.register(s)
}
return nil
}
@@ -267,6 +273,13 @@ func (c *criService) Close() error {
return nil
}
func (c *criService) register(s *grpc.Server) error {
instrumented := newInstrumentedService(c)
runtime.RegisterRuntimeServiceServer(s, instrumented)
runtime.RegisterImageServiceServer(s, instrumented)
return nil
}
// imageFSPath returns containerd image filesystem path.
// Note that if containerd changes directory layout, we also needs to change this.
func imageFSPath(rootDir, snapshotter string) string {