sandbox: add Sandboxer field to sandbox metadata

Signed-off-by: Abel Feng <fshb1988@gmail.com>
This commit is contained in:
Abel Feng
2023-06-05 21:01:31 +08:00
committed by f00589305
parent 69e501e7cd
commit 8b35976850
5 changed files with 25 additions and 4 deletions

View File

@@ -35,6 +35,7 @@ func ToProto(sandbox *Sandbox) *types.Sandbox {
Name: sandbox.Runtime.Name,
Options: protobuf.FromAny(sandbox.Runtime.Options),
},
Sandboxer: sandbox.Sandboxer,
Labels: sandbox.Labels,
CreatedAt: protobuf.ToTimestamp(sandbox.CreatedAt),
UpdatedAt: protobuf.ToTimestamp(sandbox.UpdatedAt),
@@ -61,6 +62,7 @@ func FromProto(sandboxpb *types.Sandbox) Sandbox {
Labels: sandboxpb.Labels,
Runtime: runtime,
Spec: sandboxpb.Spec,
Sandboxer: sandboxpb.Sandboxer,
CreatedAt: protobuf.FromTimestamp(sandboxpb.CreatedAt),
UpdatedAt: protobuf.FromTimestamp(sandboxpb.UpdatedAt),
Extensions: extensions,

View File

@@ -35,6 +35,8 @@ type Sandbox struct {
Runtime RuntimeOpts
// Spec carries the runtime specification used to implement the sandbox
Spec typeurl.Any
// Sandboxer is the sandbox controller who manages the sandbox
Sandboxer string
// CreatedAt is the time at which the sandbox was created
CreatedAt time.Time
// UpdatedAt is the time at which the sandbox was updated