Add context and client to SpecOpts
In order to do more advanced spec generation with images, snapshots, etc, we need to inject the context and client into the spec generation code. Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
@@ -2,11 +2,15 @@
|
||||
|
||||
package containerd
|
||||
|
||||
import specs "github.com/opencontainers/runtime-spec/specs-go"
|
||||
import (
|
||||
"context"
|
||||
|
||||
specs "github.com/opencontainers/runtime-spec/specs-go"
|
||||
)
|
||||
|
||||
// WithApparmor sets the provided apparmor profile to the spec
|
||||
func WithApparmorProfile(profile string) SpecOpts {
|
||||
return func(s *specs.Spec) error {
|
||||
return func(_ context.Context, _ *Client, s *specs.Spec) error {
|
||||
s.Process.ApparmorProfile = profile
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user