Skip WithAdditionalGIDs on Darwin

Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
This commit is contained in:
Maksym Pavlenko 2021-12-06 14:26:43 -08:00
parent 753f95e23f
commit 441bcb56d7

View File

@ -23,6 +23,7 @@ import (
"fmt" "fmt"
"os" "os"
"path/filepath" "path/filepath"
"runtime"
"strconv" "strconv"
"strings" "strings"
@ -35,7 +36,7 @@ import (
"github.com/containerd/continuity/fs" "github.com/containerd/continuity/fs"
v1 "github.com/opencontainers/image-spec/specs-go/v1" v1 "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/opencontainers/runc/libcontainer/user" "github.com/opencontainers/runc/libcontainer/user"
specs "github.com/opencontainers/runtime-spec/specs-go" "github.com/opencontainers/runtime-spec/specs-go"
"github.com/pkg/errors" "github.com/pkg/errors"
) )
@ -729,8 +730,8 @@ func WithUsername(username string) SpecOpts {
// The passed in user can be either a uid or a username. // The passed in user can be either a uid or a username.
func WithAdditionalGIDs(userstr string) SpecOpts { func WithAdditionalGIDs(userstr string) SpecOpts {
return func(ctx context.Context, client Client, c *containers.Container, s *Spec) (err error) { return func(ctx context.Context, client Client, c *containers.Container, s *Spec) (err error) {
// For LCOW additional GID's not supported // For LCOW or on Darwin additional GID's not supported
if s.Windows != nil { if s.Windows != nil || runtime.GOOS == "darwin" {
return nil return nil
} }
setProcess(s) setProcess(s)