MCPcopy Index your code
hub / github.com/containerd/containerd / cleanupShim

Method cleanupShim

plugins/sandbox/controller.go:104–121  ·  view source on GitHub ↗
(ctx context.Context, sandboxID string, svc runtimeAPI.TTRPCSandboxService)

Source from the content-addressed store, hash-verified

102var _ sandbox.Controller = (*controllerLocal)(nil)
103
104func (c *controllerLocal) cleanupShim(ctx context.Context, sandboxID string, svc runtimeAPI.TTRPCSandboxService) {
105 // Let the shim exit, then we can clean up the bundle after.
106 if _, sErr := svc.ShutdownSandbox(ctx, &runtimeAPI.ShutdownSandboxRequest{
107 SandboxID: sandboxID,
108 }); sErr != nil {
109 log.G(ctx).WithError(sErr).WithField("sandboxID", sandboxID).
110 Error("failed to shutdown sandbox")
111 }
112
113 ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
114 defer cancel()
115
116 dErr := c.shims.Delete(ctx, sandboxID)
117 if dErr != nil {
118 log.G(ctx).WithError(dErr).WithField("sandboxID", sandboxID).
119 Error("failed to delete shim")
120 }
121}
122
123func (c *controllerLocal) Create(ctx context.Context, info sandbox.Sandbox, opts ...sandbox.CreateOpt) (retErr error) {
124 var coptions sandbox.CreateOptions

Callers 2

CreateMethod · 0.95
StartMethod · 0.95

Calls 3

ShutdownSandboxMethod · 0.65
DeleteMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected