Sandbox: Add annotations to controller CreateOptions
Following the addition of annotations to the grpc/ttrpc API surface, follow suit with adding annotations to the controller api surface. Signed-off-by: Danny Canter <danny@dcantah.dev>
This commit is contained in:
parent
939ccbed42
commit
def5ff3c4b
@ -33,8 +33,9 @@ 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
|
||||
NetNSPath string
|
||||
Options typeurl.Any
|
||||
NetNSPath string
|
||||
Annotations map[string]string
|
||||
}
|
||||
|
||||
type CreateOpt func(*CreateOptions) error
|
||||
@ -68,6 +69,14 @@ func WithNetNSPath(netNSPath string) CreateOpt {
|
||||
}
|
||||
}
|
||||
|
||||
// WithAnnotations sets the provided annotations for sandbox creation.
|
||||
func WithAnnotations(annotations map[string]string) CreateOpt {
|
||||
return func(co *CreateOptions) error {
|
||||
co.Annotations = annotations
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
type StopOptions struct {
|
||||
Timeout *time.Duration
|
||||
}
|
||||
|
@ -52,7 +52,8 @@ func (s *remoteSandboxController) Create(ctx context.Context, sandboxID string,
|
||||
TypeUrl: options.Options.GetTypeUrl(),
|
||||
Value: options.Options.GetValue(),
|
||||
},
|
||||
NetnsPath: options.NetNSPath,
|
||||
NetnsPath: options.NetNSPath,
|
||||
Annotations: options.Annotations,
|
||||
})
|
||||
if err != nil {
|
||||
return errdefs.FromGRPC(err)
|
||||
|
Loading…
Reference in New Issue
Block a user