From 87346df54f4124f102c0d255bb4f06f526809132 Mon Sep 17 00:00:00 2001 From: Maksym Pavlenko Date: Mon, 27 Mar 2023 10:24:01 -0700 Subject: [PATCH] Defer uid lookups on Darwin Signed-off-by: Maksym Pavlenko --- oci/spec_opts.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/oci/spec_opts.go b/oci/spec_opts.go index 00942995b..bfa3e1296 100644 --- a/oci/spec_opts.go +++ b/oci/spec_opts.go @@ -607,7 +607,9 @@ func WithUser(userstr string) SpecOpts { // The `Username` field on the runtime spec is marked by Platform as only for Windows, and in this case it // *is* being set on a Windows host at least, but will be used as a temporary holding spot until the guest // can use the string to perform these same operations to grab the uid:gid inside. - if s.Windows != nil && s.Linux != nil { + // + // Mounts are not supported on Darwin, so using the same workaround. + if (s.Windows != nil && s.Linux != nil) || runtime.GOOS == "darwin" { s.Process.User.Username = userstr return nil }