diff --git a/api/runtime/v1/sandbox-api.pb.go b/api/runtime/v1/sandbox-api.pb.go index 9c93c32..55bef6a 100644 --- a/api/runtime/v1/sandbox-api.pb.go +++ b/api/runtime/v1/sandbox-api.pb.go @@ -1609,7 +1609,9 @@ type StartResponse struct { // Message contains details about the start result. Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // ID is the unique sandbox ID. - ID string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"` + ID string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"` + // SandboxIP is the address assigned to the sandbox network endpoint. + SandboxIp string `protobuf:"bytes,4,opt,name=sandbox_ip,json=sandboxIp,proto3" json:"sandbox_ip,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -1665,6 +1667,13 @@ func (x *StartResponse) GetID() string { return "" } +func (x *StartResponse) GetSandboxIp() string { + if x != nil { + return x.SandboxIp + } + return "" +} + // CheckpointRequest describes a synchronous checkpoint operation. type CheckpointRequest struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -3062,11 +3071,13 @@ const file_api_runtime_v1_sandbox_api_proto_rawDesc = "" + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1a?\n" + "\x11MetricLabelsEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"M\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"l\n" + "\rStartResponse\x12\x12\n" + "\x04code\x18\x01 \x01(\x05R\x04code\x12\x18\n" + "\amessage\x18\x02 \x01(\tR\amessage\x12\x0e\n" + - "\x02id\x18\x03 \x01(\tR\x02id\"\xd9\x01\n" + + "\x02id\x18\x03 \x01(\tR\x02id\x12\x1d\n" + + "\n" + + "sandbox_ip\x18\x04 \x01(\tR\tsandboxIp\"\xd9\x01\n" + "\x11CheckpointRequest\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12%\n" + "\x0echeckpoint_dir\x18\x02 \x01(\tR\rcheckpointDir\x12'\n" + diff --git a/api/runtime/v1/sandbox-api.proto b/api/runtime/v1/sandbox-api.proto index 22b96d9..f6f45bb 100644 --- a/api/runtime/v1/sandbox-api.proto +++ b/api/runtime/v1/sandbox-api.proto @@ -283,6 +283,8 @@ message StartResponse { string message = 2; // ID is the unique sandbox ID. string id = 3; + // SandboxIP is the address assigned to the sandbox network endpoint. + string sandbox_ip = 4; } // CheckpointRequest describes a synchronous checkpoint operation. diff --git a/api/runtime/v1/sandbox_api_compat_test.go b/api/runtime/v1/sandbox_api_compat_test.go index 25390e5..960f4cc 100644 --- a/api/runtime/v1/sandbox_api_compat_test.go +++ b/api/runtime/v1/sandbox_api_compat_test.go @@ -36,7 +36,7 @@ func TestV010WireContract(t *testing.T) { // Rolled for StartRequest.inject_entrypoint (field 22), which supplies the // in-sandbox destination for injected OCI image startup configuration. // Recompute after any proto change: run this test, copy the got hash. - const want = "5cbcd4bbad5035b8c2d5224e0f08944f38ee0188d5116e09ac8f16ef5419fc6b" + const want = "21eb701d4c16828d5f4ac42d6a50d6f644e038b6b967b4c5165a9dd025aed67b" if got := hex.EncodeToString(sum[:]); got != want { t.Fatalf("sandbox API descriptor hash = %s, want %s", got, want) } diff --git a/internal/server/server.go b/internal/server/server.go index 66ecaa5..61d24db 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -1637,9 +1637,10 @@ func (h *sandboxService) Start(ctx context.Context, request *runtime.StartReques }) startSucceeded = true return &runtime.StartResponse{ - Code: 0, - Message: "Succeed", - ID: sandboxID, + Code: 0, + Message: "Succeed", + ID: sandboxID, + SandboxIp: preparedResources.sandboxIP, }, nil }