containerd's `WithUser` function now resets this property, starting with
[3eda46af12b1deedab3d0802adb2e81cb3521950][1] (v1.7.0-beta.4), so we no
longer need this function.
[1]: https://github.com/containerd/containerd/commit/3eda46af12b1deedab3d0802adb2e81cb3521950
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
| ... | ... |
@@ -4,7 +4,6 @@ import ( |
| 4 | 4 |
"context" |
| 5 | 5 |
|
| 6 | 6 |
"github.com/containerd/containerd" |
| 7 |
- "github.com/containerd/containerd/containers" |
|
| 8 | 7 |
"github.com/containerd/containerd/oci" |
| 9 | 8 |
coci "github.com/containerd/containerd/oci" |
| 10 | 9 |
"github.com/containerd/containerd/pkg/apparmor" |
| ... | ... |
@@ -14,13 +13,6 @@ import ( |
| 14 | 14 |
specs "github.com/opencontainers/runtime-spec/specs-go" |
| 15 | 15 |
) |
| 16 | 16 |
|
| 17 |
-func withResetAdditionalGIDs() oci.SpecOpts {
|
|
| 18 |
- return func(_ context.Context, _ oci.Client, _ *containers.Container, s *oci.Spec) error {
|
|
| 19 |
- s.Process.User.AdditionalGids = nil |
|
| 20 |
- return nil |
|
| 21 |
- } |
|
| 22 |
-} |
|
| 23 |
- |
|
| 24 | 17 |
func getUserFromContainerd(ctx context.Context, containerdCli *containerd.Client, ec *container.ExecConfig) (specs.User, error) {
|
| 25 | 18 |
ctr, err := containerdCli.LoadContainer(ctx, ec.Container.ID) |
| 26 | 19 |
if err != nil {
|
| ... | ... |
@@ -39,7 +31,6 @@ func getUserFromContainerd(ctx context.Context, containerdCli *containerd.Client |
| 39 | 39 |
|
| 40 | 40 |
opts := []oci.SpecOpts{
|
| 41 | 41 |
coci.WithUser(ec.User), |
| 42 |
- withResetAdditionalGIDs(), |
|
| 43 | 42 |
coci.WithAdditionalGIDs(ec.User), |
| 44 | 43 |
coci.WithAppendAdditionalGroups(ec.Container.HostConfig.GroupAdd...), |
| 45 | 44 |
} |