Extract CRI instrument package
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
This commit is contained in:
@@ -98,9 +98,6 @@ const (
|
||||
|
||||
// runtimeRunhcsV1 is the runtime type for runhcs.
|
||||
runtimeRunhcsV1 = "io.containerd.runhcs.v1"
|
||||
|
||||
// name prefix for CRI sbserver specific spans
|
||||
criSpanPrefix = "pkg.cri.sbserver"
|
||||
)
|
||||
|
||||
// makeSandboxName generates sandbox name from sandbox metadata. The name
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -29,6 +29,7 @@ import (
|
||||
|
||||
"github.com/containerd/containerd"
|
||||
"github.com/containerd/containerd/oci"
|
||||
"github.com/containerd/containerd/pkg/cri/instrument"
|
||||
"github.com/containerd/containerd/pkg/cri/sbserver/podsandbox"
|
||||
"github.com/containerd/containerd/pkg/cri/streaming"
|
||||
"github.com/containerd/containerd/pkg/kmutex"
|
||||
@@ -56,24 +57,16 @@ import (
|
||||
// defaultNetworkPlugin is used for the default CNI configuration
|
||||
const defaultNetworkPlugin = "default"
|
||||
|
||||
// grpcServices are all the grpc services provided by cri containerd.
|
||||
type grpcServices interface {
|
||||
runtime.RuntimeServiceServer
|
||||
runtime.ImageServiceServer
|
||||
}
|
||||
|
||||
type grpcAlphaServices interface {
|
||||
runtime_alpha.RuntimeServiceServer
|
||||
runtime_alpha.ImageServiceServer
|
||||
}
|
||||
|
||||
// CRIService is the interface implement CRI remote service server.
|
||||
type CRIService interface {
|
||||
Run() error
|
||||
// io.Closer is used by containerd to gracefully stop cri service.
|
||||
runtime.RuntimeServiceServer
|
||||
runtime.ImageServiceServer
|
||||
// Closer is used by containerd to gracefully stop cri service.
|
||||
io.Closer
|
||||
|
||||
Run() error
|
||||
|
||||
Register(*grpc.Server) error
|
||||
grpcServices
|
||||
}
|
||||
|
||||
// criService implements CRIService.
|
||||
@@ -329,13 +322,20 @@ func (c *criService) Close() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// IsInitialized indicates whether CRI service has finished initialization.
|
||||
func (c *criService) IsInitialized() bool {
|
||||
return c.initialized.IsSet()
|
||||
}
|
||||
|
||||
func (c *criService) register(s *grpc.Server) error {
|
||||
instrumented := newInstrumentedService(c)
|
||||
instrumented := instrument.NewService(c)
|
||||
runtime.RegisterRuntimeServiceServer(s, instrumented)
|
||||
runtime.RegisterImageServiceServer(s, instrumented)
|
||||
instrumentedAlpha := newInstrumentedAlphaService(c)
|
||||
|
||||
instrumentedAlpha := instrument.NewAlphaService(c)
|
||||
runtime_alpha.RegisterRuntimeServiceServer(s, instrumentedAlpha)
|
||||
runtime_alpha.RegisterImageServiceServer(s, instrumentedAlpha)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user