(ctx context.Context, sandboxID string, svc runtimeAPI.TTRPCSandboxService)
| 102 | var _ sandbox.Controller = (*controllerLocal)(nil) |
| 103 | |
| 104 | func (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 | |
| 123 | func (c *controllerLocal) Create(ctx context.Context, info sandbox.Sandbox, opts ...sandbox.CreateOpt) (retErr error) { |
| 124 | var coptions sandbox.CreateOptions |
no test coverage detected