Update GRPC for consistency

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-06-20 17:47:59 -07:00
parent 13e7d3c393
commit 94eafaab60
56 changed files with 3941 additions and 2802 deletions

View File

@@ -180,7 +180,9 @@ func WithNewReadonlyRootFS(id string, i Image) NewContainerOpts {
func WithRuntime(name string) NewContainerOpts {
return func(ctx context.Context, client *Client, c *containers.Container) error {
c.Runtime = name
c.Runtime = &containers.Container_Runtime{
Name: name,
}
return nil
}
}
@@ -196,8 +198,10 @@ func WithImage(i Image) NewContainerOpts {
// the id must be unique within the namespace
func (c *Client) NewContainer(ctx context.Context, id string, opts ...NewContainerOpts) (Container, error) {
container := containers.Container{
ID: id,
Runtime: c.runtime,
ID: id,
Runtime: &containers.Container_Runtime{
Name: c.runtime,
},
}
for _, o := range opts {
if err := o(ctx, c, &container); err != nil {
@@ -331,7 +335,7 @@ func (c *Client) Pull(ctx context.Context, ref string, opts ...RemoteOpts) (Imag
}
is := c.ImageService()
if err := is.Put(ctx, name, desc); err != nil {
if err := is.Update(ctx, name, desc); err != nil {
return nil, err
}
i, err := is.Get(ctx, name)
@@ -448,7 +452,7 @@ func (c *Client) ContentStore() content.Store {
}
func (c *Client) SnapshotService() snapshot.Snapshotter {
return snapshotservice.NewSnapshotterFromClient(snapshotapi.NewSnapshotClient(c.conn))
return snapshotservice.NewSnapshotterFromClient(snapshotapi.NewSnapshotsClient(c.conn))
}
func (c *Client) TaskService() execution.TasksClient {