From 5dd38792a82e1f7bb0579263e8854a8b373371e4 Mon Sep 17 00:00:00 2001 From: Hajime Tazaki Date: Tue, 15 Dec 2020 08:12:22 +0900 Subject: [PATCH] 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: bd908acab ("Use path based unix socket for shims") Signed-off-by: Hajime Tazaki --- runtime/v2/shim/util_unix.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runtime/v2/shim/util_unix.go b/runtime/v2/shim/util_unix.go index b14cfb685..984224a1c 100644 --- a/runtime/v2/shim/util_unix.go +++ b/runtime/v2/shim/util_unix.go @@ -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) {