Don't unmount on Darwin when deleting bundle
@@ -21,6 +21,7 @@ import (
"fmt"
"os"
"path/filepath"
+ "runtime"
"github.com/containerd/containerd/identifiers"
"github.com/containerd/containerd/mount"
@@ -128,9 +129,11 @@ type Bundle struct {
func (b *Bundle) Delete() error {
work, werr := os.Readlink(filepath.Join(b.Path, "work"))
rootfs := filepath.Join(b.Path, "rootfs")
+ if runtime.GOOS != "darwin" {
if err := mount.UnmountAll(rootfs, 0); err != nil {
return fmt.Errorf("unmount rootfs %s: %w", rootfs, err)
}
+ }
if err := os.Remove(rootfs); err != nil && !os.IsNotExist(err) {
return fmt.Errorf("failed to remove bundle rootfs: %w", err)
}
