(ctx context.Context, container containerd.Container, spec *runtimespec.Spec)
| 380 | } |
| 381 | |
| 382 | func 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 | |
| 396 | func copySpec(spec *runtimespec.Spec) (*runtimespec.Spec, error) { |
| 397 | var copySpec runtimespec.Spec |
no test coverage detected
searching dependent graphs…