[sandbox] Add clients

Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
This commit is contained in:
Maksym Pavlenko
2021-04-19 15:19:29 -07:00
parent df234edeb4
commit eaccbf1d03
7 changed files with 436 additions and 1 deletions

View File

@@ -74,6 +74,15 @@ func WithRuntime(name string, options interface{}) NewContainerOpts {
}
}
// WithSandbox joins the container to a container group (aka sandbox) from the given ID
// Note: shim runtime must support sandboxes environments.
func WithSandbox(sandboxID string) NewContainerOpts {
return func(ctx context.Context, client *Client, c *containers.Container) error {
c.SandboxID = sandboxID
return nil
}
}
// WithImage sets the provided image as the base for the container
func WithImage(i Image) NewContainerOpts {
return func(ctx context.Context, client *Client, c *containers.Container) error {