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

Method Platform

plugins/sandbox/controller.go:201–219  ·  view source on GitHub ↗
(ctx context.Context, sandboxID string)

Source from the content-addressed store, hash-verified

199}
200
201func (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
221func (c *controllerLocal) Stop(ctx context.Context, sandboxID string, opts ...sandbox.StopOpt) error {
222 var soptions sandbox.StopOptions

Callers

nothing calls this directly

Calls 3

getSandboxMethod · 0.95
PlatformMethod · 0.65
GetPlatformMethod · 0.45

Tested by

no test coverage detected