LoadContainer loads an existing container from metadata
(ctx context.Context, id string)
| 378 | |
| 379 | // LoadContainer loads an existing container from metadata |
| 380 | func (c *Client) LoadContainer(ctx context.Context, id string) (Container, error) { |
| 381 | ctx, span := tracing.StartSpan(ctx, "client.LoadContainer") |
| 382 | defer span.End() |
| 383 | r, err := c.ContainerService().Get(ctx, id) |
| 384 | if err != nil { |
| 385 | return nil, err |
| 386 | } |
| 387 | |
| 388 | span.SetAttributes( |
| 389 | tracing.Attribute("container.id", r.ID), |
| 390 | tracing.Attribute("container.image.ref", r.Image), |
| 391 | tracing.Attribute("container.runtime.name", r.Runtime.Name), |
| 392 | tracing.Attribute("container.snapshotter.name", r.Snapshotter), |
| 393 | tracing.Attribute("container.createdAt", r.CreatedAt.Format(time.RFC3339)), |
| 394 | tracing.Attribute("container.updatedAt", r.UpdatedAt.Format(time.RFC3339)), |
| 395 | ) |
| 396 | return containerFromRecord(c, r), nil |
| 397 | } |
| 398 | |
| 399 | // RemoteContext is used to configure object resolutions and transfers with |
| 400 | // remote content stores and image providers. |