summaryrefslogtreecommitdiff
path: root/integration/plugin
diff options
context:
space:
mode:
authorCory Snider <csnider@mirantis.com>2022-03-14 15:24:29 -0400
committerCory Snider <csnider@mirantis.com>2022-03-14 16:28:57 -0400
commit098a44c07f38a14147a57feffa31b551a47f3c73 (patch)
treea5df884ee2ffb035b884ed57ede9ecbee240b3c8 /integration/plugin
parent16009830c2e2f3840ee73459918289f4bf54bd1d (diff)
downloaddocker-098a44c07f38a14147a57feffa31b551a47f3c73.tar.gz
Finish refactor of UID/GID usage to a new struct
Finish the refactor which was partially completed with commit 34536c498d56, passing around IdentityMapping structs instead of pairs of []IDMap slices. Existing code which uses []IDMap relies on zero-valued fields to be valid, empty mappings. So in order to successfully finish the refactoring without introducing bugs, their replacement therefore also needs to have a useful zero value which represents an empty mapping. Change IdentityMapping to be a pass-by-value type so that there are no nil pointers to worry about. The functionality provided by the deprecated NewIDMappingsFromMaps function is required by unit tests to to construct arbitrary IdentityMapping values. And the daemon will always need to access the mappings to pass them to the Linux kernel. Accommodate these use cases by exporting the struct fields instead. BuildKit currently depends on the UIDs and GIDs methods so we cannot get rid of them yet. Signed-off-by: Cory Snider <csnider@mirantis.com>
Diffstat (limited to 'integration/plugin')
-rw-r--r--integration/plugin/graphdriver/external_test.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/integration/plugin/graphdriver/external_test.go b/integration/plugin/graphdriver/external_test.go
index 57fb27856d..cb261774b8 100644
--- a/integration/plugin/graphdriver/external_test.go
+++ b/integration/plugin/graphdriver/external_test.go
@@ -19,6 +19,7 @@ import (
"github.com/docker/docker/integration/internal/container"
"github.com/docker/docker/integration/internal/requirement"
"github.com/docker/docker/pkg/archive"
+ "github.com/docker/docker/pkg/idtools"
"github.com/docker/docker/pkg/plugins"
"github.com/docker/docker/testutil/daemon"
"gotest.tools/v3/assert"
@@ -146,9 +147,9 @@ func setupPlugin(t *testing.T, ec map[string]*graphEventsCounter, ext string, mu
base, err := os.MkdirTemp("", name)
assert.NilError(t, err)
- vfsProto, err := vfs.Init(base, []string{}, nil, nil)
+ vfsProto, err := vfs.Init(base, []string{}, idtools.IdentityMapping{})
assert.NilError(t, err, "error initializing graph driver")
- driver := graphdriver.NewNaiveDiffDriver(vfsProto, nil, nil)
+ driver := graphdriver.NewNaiveDiffDriver(vfsProto, idtools.IdentityMapping{})
ec[ext] = &graphEventsCounter{}
mux.HandleFunc("/Plugin.Activate", func(w http.ResponseWriter, r *http.Request) {