sandbox: merge address and protocol to one url
Signed-off-by: Abel Feng <fshb1988@gmail.com>
This commit is contained in:
@@ -123,7 +123,7 @@ func (c *criService) StartContainer(ctx context.Context, r *runtime.StartContain
|
||||
endpoint := sandbox.Endpoint
|
||||
if endpoint.IsValid() {
|
||||
taskOpts = append(taskOpts,
|
||||
containerd.WithTaskAPIEndpoint(endpoint.Address, endpoint.Protocol, endpoint.Version))
|
||||
containerd.WithTaskAPIEndpoint(endpoint.Address, endpoint.Version))
|
||||
}
|
||||
|
||||
task, err := container.NewTask(ctx, ioCreation, taskOpts...)
|
||||
|
||||
@@ -127,7 +127,6 @@ func (c *criService) recover(ctx context.Context) error {
|
||||
state = sandboxstore.StateNotReady
|
||||
}
|
||||
} else {
|
||||
endpoint.Protocol = status.Protocol
|
||||
endpoint.Version = status.Version
|
||||
endpoint.Address = status.Address
|
||||
if code, ok := runtime.PodSandboxState_value[status.State]; ok {
|
||||
|
||||
@@ -265,11 +265,10 @@ func (c *criService) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandbox
|
||||
return nil, fmt.Errorf("failed to start sandbox %q: %w", id, err)
|
||||
}
|
||||
|
||||
if ctrl.Protocol != "" && ctrl.Address != "" {
|
||||
if ctrl.Address != "" {
|
||||
sandbox.Endpoint = sandboxstore.Endpoint{
|
||||
Protocol: ctrl.Protocol,
|
||||
Version: ctrl.Version,
|
||||
Address: ctrl.Address,
|
||||
Version: ctrl.Version,
|
||||
Address: ctrl.Address,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -52,13 +52,12 @@ type Sandbox struct {
|
||||
}
|
||||
|
||||
type Endpoint struct {
|
||||
Address string
|
||||
Protocol string
|
||||
Version uint32
|
||||
Address string
|
||||
Version uint32
|
||||
}
|
||||
|
||||
func (e *Endpoint) IsValid() bool {
|
||||
return e.Protocol != "" && e.Address != ""
|
||||
return e.Address != ""
|
||||
}
|
||||
|
||||
// NewSandbox creates an internally used sandbox type. This functions reminds
|
||||
|
||||
Reference in New Issue
Block a user