Browse code

Move pkg/idtools to daemon/internal/idtools

Signed-off-by: Derek McGowan <derek@mcg.dev>

Derek McGowan authored on 2025/07/25 04:12:07
Showing 15 changed files
... ...
@@ -11,10 +11,10 @@ import (
11 11
 	cerrdefs "github.com/containerd/errdefs"
12 12
 	"github.com/containerd/log"
13 13
 	"github.com/docker/docker/daemon/container"
14
+	"github.com/docker/docker/daemon/internal/idtools"
14 15
 	"github.com/docker/docker/daemon/pkg/oci"
15 16
 	volumemounts "github.com/docker/docker/daemon/volume/mounts"
16 17
 	volumeopts "github.com/docker/docker/daemon/volume/service/opts"
17
-	"github.com/docker/docker/pkg/idtools"
18 18
 	containertypes "github.com/moby/moby/api/types/container"
19 19
 	mounttypes "github.com/moby/moby/api/types/mount"
20 20
 	"github.com/opencontainers/selinux/go-selinux/label"
... ...
@@ -41,6 +41,7 @@ import (
41 41
 	"github.com/docker/docker/daemon/images"
42 42
 	"github.com/docker/docker/daemon/internal/distribution"
43 43
 	dmetadata "github.com/docker/docker/daemon/internal/distribution/metadata"
44
+	"github.com/docker/docker/daemon/internal/idtools"
44 45
 	"github.com/docker/docker/daemon/internal/image"
45 46
 	"github.com/docker/docker/daemon/internal/layer"
46 47
 	libcontainerdtypes "github.com/docker/docker/daemon/internal/libcontainerd/types"
... ...
@@ -62,7 +63,6 @@ import (
62 62
 	"github.com/docker/docker/dockerversion"
63 63
 	"github.com/docker/docker/pkg/authorization"
64 64
 	"github.com/docker/docker/pkg/fileutils"
65
-	"github.com/docker/docker/pkg/idtools"
66 65
 	"github.com/docker/docker/pkg/plugingetter"
67 66
 	"github.com/docker/docker/pkg/sysinfo"
68 67
 	"github.com/moby/buildkit/util/grpcerrors"
... ...
@@ -9,9 +9,9 @@ import (
9 9
 
10 10
 	cerrdefs "github.com/containerd/errdefs"
11 11
 	"github.com/docker/docker/daemon/container"
12
+	"github.com/docker/docker/daemon/internal/idtools"
12 13
 	"github.com/docker/docker/daemon/libnetwork"
13 14
 	volumesservice "github.com/docker/docker/daemon/volume/service"
14
-	"github.com/docker/docker/pkg/idtools"
15 15
 	"github.com/docker/go-connections/nat"
16 16
 	containertypes "github.com/moby/moby/api/types/container"
17 17
 	"github.com/pkg/errors"
18 18
new file mode 100644
... ...
@@ -0,0 +1,8 @@
0
+package idtools
1
+
2
+// Identity is either a UID and GID pair or a SID (but not both)
3
+type Identity struct {
4
+	UID int
5
+	GID int
6
+	SID string
7
+}
... ...
@@ -14,11 +14,11 @@ import (
14 14
 	"sync"
15 15
 
16 16
 	"github.com/containerd/log"
17
+	"github.com/docker/docker/daemon/internal/idtools"
17 18
 	"github.com/docker/docker/daemon/internal/quota"
18 19
 	"github.com/docker/docker/daemon/names"
19 20
 	"github.com/docker/docker/daemon/volume"
20 21
 	"github.com/docker/docker/errdefs"
21
-	"github.com/docker/docker/pkg/idtools"
22 22
 	"github.com/moby/sys/atomicwriter"
23 23
 	"github.com/moby/sys/user"
24 24
 	"github.com/pkg/errors"
... ...
@@ -10,8 +10,8 @@ import (
10 10
 	"testing"
11 11
 
12 12
 	cerrdefs "github.com/containerd/errdefs"
13
+	"github.com/docker/docker/daemon/internal/idtools"
13 14
 	"github.com/docker/docker/daemon/internal/quota"
14
-	"github.com/docker/docker/pkg/idtools"
15 15
 	"gotest.tools/v3/assert"
16 16
 	is "gotest.tools/v3/assert/cmp"
17 17
 )
... ...
@@ -8,7 +8,7 @@ import (
8 8
 	"strings"
9 9
 	"testing"
10 10
 
11
-	"github.com/docker/docker/pkg/idtools"
11
+	"github.com/docker/docker/daemon/internal/idtools"
12 12
 	"github.com/moby/sys/mountinfo"
13 13
 	"gotest.tools/v3/skip"
14 14
 )
... ...
@@ -7,9 +7,9 @@ import (
7 7
 	"syscall"
8 8
 
9 9
 	"github.com/containerd/log"
10
+	"github.com/docker/docker/daemon/internal/idtools"
10 11
 	"github.com/docker/docker/daemon/volume"
11 12
 	"github.com/docker/docker/daemon/volume/safepath"
12
-	"github.com/docker/docker/pkg/idtools"
13 13
 	"github.com/docker/docker/pkg/stringid"
14 14
 	mounttypes "github.com/moby/moby/api/types/mount"
15 15
 	"github.com/moby/sys/user"
... ...
@@ -3,10 +3,10 @@
3 3
 package service
4 4
 
5 5
 import (
6
+	"github.com/docker/docker/daemon/internal/idtools"
6 7
 	"github.com/docker/docker/daemon/volume"
7 8
 	"github.com/docker/docker/daemon/volume/drivers"
8 9
 	"github.com/docker/docker/daemon/volume/local"
9
-	"github.com/docker/docker/pkg/idtools"
10 10
 	"github.com/pkg/errors"
11 11
 )
12 12
 
... ...
@@ -3,8 +3,8 @@
3 3
 package service
4 4
 
5 5
 import (
6
+	"github.com/docker/docker/daemon/internal/idtools"
6 7
 	"github.com/docker/docker/daemon/volume/drivers"
7
-	"github.com/docker/docker/pkg/idtools"
8 8
 )
9 9
 
10 10
 func setupDefaultDriver(_ *drivers.Store, _ string, _ idtools.Identity) error { return nil }
... ...
@@ -7,11 +7,11 @@ import (
7 7
 
8 8
 	"github.com/containerd/log"
9 9
 	"github.com/docker/docker/daemon/internal/directory"
10
+	"github.com/docker/docker/daemon/internal/idtools"
10 11
 	"github.com/docker/docker/daemon/volume"
11 12
 	"github.com/docker/docker/daemon/volume/drivers"
12 13
 	"github.com/docker/docker/daemon/volume/service/opts"
13 14
 	"github.com/docker/docker/errdefs"
14
-	"github.com/docker/docker/pkg/idtools"
15 15
 	"github.com/docker/docker/pkg/plugingetter"
16 16
 	"github.com/docker/docker/pkg/stringid"
17 17
 	"github.com/moby/moby/api/types/events"
... ...
@@ -6,12 +6,12 @@ import (
6 6
 	"path/filepath"
7 7
 	"testing"
8 8
 
9
+	"github.com/docker/docker/daemon/internal/idtools"
9 10
 	"github.com/docker/docker/daemon/volume"
10 11
 	volumedrivers "github.com/docker/docker/daemon/volume/drivers"
11 12
 	"github.com/docker/docker/daemon/volume/local"
12 13
 	"github.com/docker/docker/daemon/volume/service/opts"
13 14
 	"github.com/docker/docker/daemon/volume/testutils"
14
-	"github.com/docker/docker/pkg/idtools"
15 15
 	"gotest.tools/v3/assert"
16 16
 	is "gotest.tools/v3/assert/cmp"
17 17
 )
... ...
@@ -11,9 +11,9 @@ import (
11 11
 
12 12
 	"github.com/containerd/log"
13 13
 	"github.com/docker/docker/daemon/container"
14
+	"github.com/docker/docker/daemon/internal/idtools"
14 15
 	volumemounts "github.com/docker/docker/daemon/volume/mounts"
15 16
 	"github.com/docker/docker/internal/cleanups"
16
-	"github.com/docker/docker/pkg/idtools"
17 17
 	"github.com/moby/moby/api/types/events"
18 18
 	mounttypes "github.com/moby/moby/api/types/mount"
19 19
 	"github.com/pkg/errors"
... ...
@@ -5,9 +5,9 @@ import (
5 5
 
6 6
 	"github.com/containerd/log"
7 7
 	"github.com/docker/docker/daemon/container"
8
+	"github.com/docker/docker/daemon/internal/idtools"
8 9
 	volumemounts "github.com/docker/docker/daemon/volume/mounts"
9 10
 	"github.com/docker/docker/internal/cleanups"
10
-	"github.com/docker/docker/pkg/idtools"
11 11
 	"github.com/moby/moby/api/types/mount"
12 12
 )
13 13
 
14 14
deleted file mode 100644
... ...
@@ -1,8 +0,0 @@
1
-package idtools
2
-
3
-// Identity is either a UID and GID pair or a SID (but not both)
4
-type Identity struct {
5
-	UID int
6
-	GID int
7
-	SID string
8
-}