Add cgroup delete opt for ns deletion
Closes #3305 This adds an opt and a `--cgroup,-c` flag to `ctr namespaces rm` to remove the cgroup that is commonly created with runtimes. Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
@@ -129,7 +129,15 @@ func (s *namespaceStore) List(ctx context.Context) ([]string, error) {
|
||||
return namespaces, nil
|
||||
}
|
||||
|
||||
func (s *namespaceStore) Delete(ctx context.Context, namespace string) error {
|
||||
func (s *namespaceStore) Delete(ctx context.Context, namespace string, opts ...namespaces.DeleteOpts) error {
|
||||
i := &namespaces.DeleteInfo{
|
||||
Name: namespace,
|
||||
}
|
||||
for _, o := range opts {
|
||||
if err := o(ctx, i); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
bkt := getBucket(s.tx, bucketKeyVersion)
|
||||
if empty, err := s.namespaceEmpty(ctx, namespace); err != nil {
|
||||
return err
|
||||
|
Reference in New Issue
Block a user