Refactor sandbox controller interface

Update the sandbox controller interface to use local types rather than
using the API types.

Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
Derek McGowan
2023-01-18 21:53:34 -08:00
parent 20de989afc
commit 2717685dad
21 changed files with 378 additions and 355 deletions

View File

@@ -67,14 +67,14 @@ func (c *criService) CreateContainer(ctx context.Context, r *runtime.CreateConta
return nil, fmt.Errorf("failed to get sandbox controller: %w", err)
}
statusResponse, err := controller.Status(ctx, sandbox.ID, false)
cstatus, err := controller.Status(ctx, sandbox.ID, false)
if err != nil {
return nil, fmt.Errorf("failed to get controller status: %w", err)
}
var (
sandboxID = statusResponse.GetID()
sandboxPid = statusResponse.GetPid()
sandboxID = cstatus.SandboxID
sandboxPid = cstatus.Pid
)
// Generate unique id and name for the container and reserve the name.