(ctx context.Context, sandboxID string)
| 199 | } |
| 200 | |
| 201 | func (c *controllerLocal) Platform(ctx context.Context, sandboxID string) (imagespec.Platform, error) { |
| 202 | svc, err := c.getSandbox(ctx, sandboxID) |
| 203 | if err != nil { |
| 204 | return imagespec.Platform{}, err |
| 205 | } |
| 206 | |
| 207 | response, err := svc.Platform(ctx, &runtimeAPI.PlatformRequest{SandboxID: sandboxID}) |
| 208 | if err != nil { |
| 209 | return imagespec.Platform{}, fmt.Errorf("failed to get sandbox platform: %w", errgrpc.ToNative(err)) |
| 210 | } |
| 211 | |
| 212 | var platform imagespec.Platform |
| 213 | if p := response.GetPlatform(); p != nil { |
| 214 | platform.OS = p.OS |
| 215 | platform.Architecture = p.Architecture |
| 216 | platform.Variant = p.Variant |
| 217 | } |
| 218 | return platform, nil |
| 219 | } |
| 220 | |
| 221 | func (c *controllerLocal) Stop(ctx context.Context, sandboxID string, opts ...sandbox.StopOpt) error { |
| 222 | var soptions sandbox.StopOptions |
nothing calls this directly
no test coverage detected