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

@@ -143,10 +143,12 @@ func (b *binary) Start(ctx context.Context, opts *types.Any, onClose func()) (_
if err := writeBootstrapParams(filepath.Join(b.bundle.Path, "bootstrap.json"), params); err != nil {
return nil, fmt.Errorf("failed to write bootstrap.json: %w", err)
}
// The address is in the form like ttrpc+unix://<uds-path> or grpc+vsock://<cid>:<port>
address := fmt.Sprintf("%s+%s", params.Protocol, params.Address)
return &shim{
bundle: b.bundle,
client: conn,
address: address,
version: params.Version,
}, nil
}