Add Load for container and Task with Attach
This adds both container and task loading of running tasks as well as reattaching to the IO of the task after load. Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
10
client.go
10
client.go
@@ -203,6 +203,16 @@ func (c *Client) NewContainer(ctx context.Context, id string, spec *specs.Spec,
|
||||
return containerFromProto(c, r.Container), nil
|
||||
}
|
||||
|
||||
func (c *Client) LoadContainer(ctx context.Context, id string) (Container, error) {
|
||||
response, err := c.ContainerService().Get(ctx, &containers.GetContainerRequest{
|
||||
ID: id,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return containerFromProto(c, response.Container), nil
|
||||
}
|
||||
|
||||
type RemoteOpts func(*Client, *RemoteContext) error
|
||||
|
||||
// RemoteContext is used to configure object resolutions and transfers with
|
||||
|
Reference in New Issue
Block a user