Skip to content

Commit 96dbb08

Browse files
committed
Change runtime options to *Any
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
1 parent 72831b6 commit 96dbb08

File tree

10 files changed

+156
-354
lines changed

10 files changed

+156
-354
lines changed

api/services/containers/v1/containers.pb.go

Lines changed: 76 additions & 181 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/services/containers/v1/containers.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ message Container {
5757
// Name is the name of the runtime.
5858
string name = 1;
5959
// Options specify additional runtime initialization options.
60-
map<string, string> options = 2;
60+
google.protobuf.Any options = 2;
6161
}
6262
// Runtime specifies which runtime to use for executing this container.
6363
Runtime runtime = 4;

api/services/events/v1/container.pb.go

Lines changed: 45 additions & 148 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/services/events/v1/container.proto

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ syntax = "proto3";
33
package containerd.services.events.v1;
44

55
import "gogoproto/gogo.proto";
6+
import "google/protobuf/any.proto";
67

78
option go_package = "github.com/containerd/containerd/api/services/events/v1;events";
89

@@ -11,7 +12,7 @@ message ContainerCreate {
1112
string image = 2;
1213
message Runtime {
1314
string name = 1;
14-
map<string, string> options = 2;
15+
google.protobuf.Any options = 2;
1516
}
1617
Runtime runtime = 3;
1718
}

api/services/events/v1/events.pb.go

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/services/events/v1/runtime.pb.go

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,10 @@ func WithNewReadonlyRootFS(id string, i Image) NewContainerOpts {
197197

198198
// WithRuntime allows a user to specify the runtime name and additional options that should
199199
// be used to create tasks for the container
200-
func WithRuntime(name string, options map[string]string) NewContainerOpts {
200+
func WithRuntime(name string) NewContainerOpts {
201201
return func(ctx context.Context, client *Client, c *containers.Container) error {
202202
c.Runtime = &containers.Container_Runtime{
203-
Name: name,
204-
Options: options,
203+
Name: name,
205204
}
206205
return nil
207206
}

containers/containers.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ package containers
33
import (
44
"context"
55
"time"
6+
7+
"github.com/gogo/protobuf/types"
68
)
79

810
// Container represents the set of data pinned by a container. Unless otherwise
@@ -22,7 +24,7 @@ type Container struct {
2224

2325
type RuntimeInfo struct {
2426
Name string
25-
Options map[string]string
27+
Options *types.Any
2628
}
2729

2830
type Store interface {

0 commit comments

Comments
 (0)