MCPcopy
hub / github.com/containerd/containerd / NewRuntimeService

Function NewRuntimeService

integration/remote/remote_runtime.go:61–78  ·  view source on GitHub ↗

NewRuntimeService creates a legacy-style CRI runtime client backed by the upstream Kubernetes CRI client.

(endpoint string, connectionTimeout time.Duration)

Source from the content-addressed store, hash-verified

59// NewRuntimeService creates a legacy-style CRI runtime client backed by the
60// upstream Kubernetes CRI client.
61func NewRuntimeService(endpoint string, connectionTimeout time.Duration) (*RuntimeService, error) {
62 runtimeService, err := upstreamcri.NewRemoteRuntimeService(context.Background(), endpoint, connectionTimeout, nil, false)
63 if err != nil {
64 return nil, err
65 }
66
67 runtimeConn, err := newRuntimeClientConn(endpoint)
68 if err != nil {
69 _ = runtimeService.Close(context.Background())
70 return nil, err
71 }
72
73 return &RuntimeService{
74 runtimeService: runtimeService,
75 runtimeClient: runtimeapi.NewRuntimeServiceClient(runtimeConn),
76 runtimeConn: runtimeConn,
77 }, nil
78}
79
80func newRuntimeClientConn(endpoint string) (*grpc.ClientConn, error) {
81 addr, dialer, err := criutil.GetAddressAndDialer(endpoint)

Callers 5

criRuntimeServiceMethod · 0.92
isReadyMethod · 0.92
ConnectDaemonsFunction · 0.92
criTestFunction · 0.92

Calls 2

newRuntimeClientConnFunction · 0.85
CloseMethod · 0.65

Tested by 4

criRuntimeServiceMethod · 0.74
isReadyMethod · 0.74
ConnectDaemonsFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…