darwin: use the default values for socketRoot variable
Since the /run directory on macOS is read-only, darwin containerd should
use a different directory.  Use the pre-defined default values instead
to avoid this issue.
Fixes: ("Use path based unix socket for shims")
@@ -30,6 +30,7 @@ import (
"syscall"
"time"
+ "github.com/containerd/containerd/defaults"
"github.com/containerd/containerd/namespaces"
"github.com/containerd/containerd/pkg/dialer"
"github.com/containerd/containerd/sys"
@@ -63,7 +64,7 @@ func AdjustOOMScore(pid int) error {
return nil
}
-const socketRoot = "/run/containerd"
+const socketRoot = defaults.DefaultStateDir
// SocketAddress returns a socket address
func SocketAddress(ctx context.Context, socketPath, id string) (string, error) {
