MCPcopy Create free account
hub / github.com/containerd/nerdctl / updateContainerSpec

Function updateContainerSpec

cmd/nerdctl/container/container_update.go:382–394  ·  view source on GitHub ↗
(ctx context.Context, container containerd.Container, spec *runtimespec.Spec)

Source from the content-addressed store, hash-verified

380}
381
382func updateContainerSpec(ctx context.Context, container containerd.Container, spec *runtimespec.Spec) error {
383 if err := container.Update(ctx, func(ctx context.Context, client *containerd.Client, c *containers.Container) error {
384 a, err := typeurl.MarshalAny(spec)
385 if err != nil {
386 return fmt.Errorf("failed to marshal spec %+v:%w", spec, err)
387 }
388 c.Spec = a
389 return nil
390 }); err != nil {
391 return fmt.Errorf("failed to update container spec:%w", err)
392 }
393 return nil
394}
395
396func copySpec(spec *runtimespec.Spec) (*runtimespec.Spec, error) {
397 var copySpec runtimespec.Spec

Callers 1

updateContainerFunction · 0.85

Calls 1

UpdateMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…