Update GRPC for consistency
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
14
client.go
14
client.go
@@ -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 {
|
||||
|
Reference in New Issue
Block a user