sandbox: merge address and protocol to one url

Signed-off-by: Abel Feng <fshb1988@gmail.com>
This commit is contained in:
Abel Feng
2024-04-23 14:28:01 +08:00
parent c3b306240e
commit de38490ed6
19 changed files with 281 additions and 333 deletions

View File

@@ -188,12 +188,11 @@ func (c *controllerLocal) Start(ctx context.Context, sandboxID string) (sandbox.
c.cleanupShim(ctx, sandboxID, svc)
return sandbox.ControllerInstance{}, fmt.Errorf("failed to start sandbox %s: %w", sandboxID, errdefs.FromGRPC(err))
}
address, protocol, version := shim.Endpoint()
address, version := shim.Endpoint()
return sandbox.ControllerInstance{
SandboxID: sandboxID,
Pid: resp.GetPid(),
Address: address,
Protocol: protocol,
Version: uint32(version),
CreatedAt: resp.GetCreatedAt().AsTime(),
}, nil
@@ -309,7 +308,7 @@ func (c *controllerLocal) Status(ctx context.Context, sandboxID string, verbose
if err != nil {
return sandbox.ControllerStatus{}, fmt.Errorf("unable to find sandbox %q", sandboxID)
}
address, protocol, version := shim.Endpoint()
address, version := shim.Endpoint()
return sandbox.ControllerStatus{
SandboxID: resp.GetSandboxID(),
@@ -320,7 +319,6 @@ func (c *controllerLocal) Status(ctx context.Context, sandboxID string, verbose
ExitedAt: resp.GetExitedAt().AsTime(),
Extra: resp.GetExtra(),
Address: address,
Protocol: protocol,
Version: uint32(version),
}, nil
}

View File

@@ -157,10 +157,9 @@ func (l *local) Create(ctx context.Context, r *api.CreateTaskRequest, _ ...grpc.
}
var (
checkpointPath string
taskAPIAddress string
taskAPIProtocol string
taskAPIVersion uint32
checkpointPath string
taskAPIAddress string
taskAPIVersion uint32
)
if r.Options != nil {
@@ -170,7 +169,6 @@ func (l *local) Create(ctx context.Context, r *api.CreateTaskRequest, _ ...grpc.
}
checkpointPath = taskOptions.CriuImagePath
taskAPIAddress = taskOptions.TaskApiAddress
taskAPIProtocol = taskOptions.TaskApiProtocol
taskAPIVersion = taskOptions.TaskApiVersion
}
@@ -212,7 +210,6 @@ func (l *local) Create(ctx context.Context, r *api.CreateTaskRequest, _ ...grpc.
TaskOptions: r.Options,
SandboxID: container.SandboxID,
Address: taskAPIAddress,
Protocol: taskAPIProtocol,
Version: taskAPIVersion,
}
if r.RuntimePath != "" {