sandbox: create sandbox with network namespace path
Signed-off-by: Zhang Tianyang <burning9699@gmail.com>
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user