[sandbox] Address PR review comments

Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
This commit is contained in:
Maksym Pavlenko
2021-11-07 17:55:47 -08:00
parent 6343fe3ea2
commit 00f7a6bf2b
10 changed files with 37 additions and 23 deletions

View File

@@ -22,7 +22,7 @@ file {
java_package: "com.google.protobuf"
java_outer_classname: "AnyProto"
java_multiple_files: true
go_package: "google.golang.org/protobuf/types/known/anypb"
go_package: "github.com/golang/protobuf/ptypes/any"
objc_class_prefix: "GPB"
csharp_namespace: "Google.Protobuf.WellKnownTypes"
}
@@ -458,7 +458,7 @@ file {
java_package: "com.google.protobuf"
java_outer_classname: "TimestampProto"
java_multiple_files: true
go_package: "google.golang.org/protobuf/types/known/timestamppb"
go_package: "github.com/golang/protobuf/ptypes/timestamp"
cc_enable_arenas: true
objc_class_prefix: "GPB"
csharp_namespace: "Google.Protobuf.WellKnownTypes"
@@ -800,7 +800,7 @@ file {
java_package: "com.google.protobuf"
java_outer_classname: "EmptyProto"
java_multiple_files: true
go_package: "google.golang.org/protobuf/types/known/emptypb"
go_package: "github.com/golang/protobuf/ptypes/empty"
cc_enable_arenas: true
objc_class_prefix: "GPB"
csharp_namespace: "Google.Protobuf.WellKnownTypes"
@@ -824,7 +824,7 @@ file {
java_package: "com.google.protobuf"
java_outer_classname: "FieldMaskProto"
java_multiple_files: true
go_package: "google.golang.org/protobuf/types/known/fieldmaskpb"
go_package: "google.golang.org/genproto/protobuf/field_mask;field_mask"
cc_enable_arenas: true
objc_class_prefix: "GPB"
csharp_namespace: "Google.Protobuf.WellKnownTypes"

View File

@@ -30,14 +30,14 @@ var _ = time.Kitchen
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// Sandbox represents a sandbox metadata object that keeps all info required by controller to
// work with a particular instance. containerd keeps this in metadata store and sends it to a controller with
// each request, so they can reflect sandbox state changes (by updating the corresponding fields).
// work with a particular instance.
type Sandbox struct {
// SandboxID is a unique instance identifier within namespace
SandboxID string `protobuf:"bytes,1,opt,name=sandbox_id,json=sandboxId,proto3" json:"sandbox_id,omitempty"`
// Runtime specifies which runtime to use for executing this container.
Runtime Sandbox_Runtime `protobuf:"bytes,2,opt,name=runtime,proto3" json:"runtime"`
// Spec is sandbox configuration (kin of OCI runtime spec, but for VM)
// Spec is sandbox configuration (kin of OCI runtime spec), spec's data will be written to a config.json file in the
// bundle directory (similary to OCI spec).
Spec *types.Any `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec,omitempty"`
// Labels provides an area to include arbitrary data on containers.
Labels map[string]string `protobuf:"bytes,4,rep,name=labels,proto3" json:"labels" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
@@ -87,7 +87,8 @@ var xxx_messageInfo_Sandbox proto.InternalMessageInfo
type Sandbox_Runtime struct {
// Name is the name of the runtime.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// Options specify additional runtime initialization options.
// Options specify additional runtime initialization options for the shim (this data will be available in StartShim).
// Typically this data expected to be runtime shim implementation specific.
Options *types.Any `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`

View File

@@ -25,20 +25,21 @@ import "google/protobuf/timestamp.proto";
option go_package = "github.com/containerd/containerd/api/types;types";
// Sandbox represents a sandbox metadata object that keeps all info required by controller to
// work with a particular instance. containerd keeps this in metadata store and sends it to a controller with
// each request, so they can reflect sandbox state changes (by updating the corresponding fields).
// work with a particular instance.
message Sandbox {
// SandboxID is a unique instance identifier within namespace
string sandbox_id = 1;
message Runtime {
// Name is the name of the runtime.
string name = 1;
// Options specify additional runtime initialization options.
// Options specify additional runtime initialization options for the shim (this data will be available in StartShim).
// Typically this data expected to be runtime shim implementation specific.
google.protobuf.Any options = 2;
}
// Runtime specifies which runtime to use for executing this container.
Runtime runtime = 2 [(gogoproto.nullable) = false];
// Spec is sandbox configuration (kin of OCI runtime spec, but for VM)
// Spec is sandbox configuration (kin of OCI runtime spec), spec's data will be written to a config.json file in the
// bundle directory (similary to OCI spec).
google.protobuf.Any spec = 3;
// Labels provides an area to include arbitrary data on containers.
map<string, string> labels = 4 [(gogoproto.nullable) = false];