Skip to content

Commit

Permalink
Merge pull request moby#46722 from thaJeztah/dedup_additionalgroups
Browse files Browse the repository at this point in the history
daemon: remove redundant withResetAdditionalGIDs option
  • Loading branch information
thaJeztah authored Oct 25, 2023
2 parents 460e1b3 + 4170186 commit 4776a9e
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions daemon/exec_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"

"github.com/containerd/containerd"
"github.com/containerd/containerd/containers"
"github.com/containerd/containerd/oci"
coci "github.com/containerd/containerd/oci"
"github.com/containerd/containerd/pkg/apparmor"
Expand All @@ -14,13 +13,6 @@ import (
specs "github.com/opencontainers/runtime-spec/specs-go"
)

func withResetAdditionalGIDs() oci.SpecOpts {
return func(_ context.Context, _ oci.Client, _ *containers.Container, s *oci.Spec) error {
s.Process.User.AdditionalGids = nil
return nil
}
}

func getUserFromContainerd(ctx context.Context, containerdCli *containerd.Client, ec *container.ExecConfig) (specs.User, error) {
ctr, err := containerdCli.LoadContainer(ctx, ec.Container.ID)
if err != nil {
Expand All @@ -39,7 +31,6 @@ func getUserFromContainerd(ctx context.Context, containerdCli *containerd.Client

opts := []oci.SpecOpts{
coci.WithUser(ec.User),
withResetAdditionalGIDs(),
coci.WithAdditionalGIDs(ec.User),
coci.WithAppendAdditionalGroups(ec.Container.HostConfig.GroupAdd...),
}
Expand Down

0 comments on commit 4776a9e

Please sign in to comment.