Revert "Add support for mounts on Darwin"

This reverts commit 2799b28e61.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
Akihiro Suda
2023-07-19 00:22:20 +09:00
parent e939d13195
commit 98f27e1d9c
10 changed files with 171 additions and 200 deletions

View File

@@ -21,6 +21,7 @@ import (
"fmt"
"os"
"path/filepath"
"runtime"
"github.com/containerd/containerd/identifiers"
"github.com/containerd/containerd/mount"
@@ -128,8 +129,10 @@ type Bundle struct {
func (b *Bundle) Delete() error {
work, werr := os.Readlink(filepath.Join(b.Path, "work"))
rootfs := filepath.Join(b.Path, "rootfs")
if err := mount.UnmountRecursive(rootfs, 0); err != nil {
return fmt.Errorf("unmount rootfs %s: %w", rootfs, err)
if runtime.GOOS != "darwin" {
if err := mount.UnmountRecursive(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)