sandbox: create sandbox with network namespace path

Signed-off-by: Zhang Tianyang <burning9699@gmail.com>
This commit is contained in:
Zhang Tianyang
2023-02-22 15:58:24 +08:00
parent 8cb00f45c9
commit 5144ba9c49
9 changed files with 384 additions and 337 deletions

View File

@@ -32,7 +32,8 @@ type CreateOptions struct {
// CRI will use this to pass PodSandboxConfig.
// Don't confuse this with Runtime options, which are passed at shim instance start
// to setup global shim configuration.
Options typeurl.Any
Options typeurl.Any
NetNSPath string
}
type CreateOpt func(*CreateOptions) error
@@ -59,6 +60,14 @@ func WithOptions(options any) CreateOpt {
}
}
// WithNetNSPath used to assign network namespace path of a sandbox.
func WithNetNSPath(netNSPath string) CreateOpt {
return func(co *CreateOptions) error {
co.NetNSPath = netNSPath
return nil
}
}
type StopOptions struct {
Timeout *time.Duration
}