MCPcopy Create free account
hub / github.com/containers/image / newStoreWithGraphDriverOptions

Function newStoreWithGraphDriverOptions

storage/storage_test.go:65–92  ·  view source on GitHub ↗
(t *testing.T, options []string)

Source from the content-addressed store, hash-verified

63}
64
65func newStoreWithGraphDriverOptions(t *testing.T, options []string) storage.Store {
66 wd := t.TempDir()
67 run := filepath.Join(wd, "run")
68 root := filepath.Join(wd, "root")
69 Transport.SetDefaultUIDMap([]idtools.IDMap{{
70 ContainerID: 0,
71 HostID: os.Getuid(),
72 Size: 1,
73 }})
74 Transport.SetDefaultGIDMap([]idtools.IDMap{{
75 ContainerID: 0,
76 HostID: os.Getgid(),
77 Size: 1,
78 }})
79 store, err := storage.GetStore(storage.StoreOptions{
80 RunRoot: run,
81 GraphRoot: root,
82 GraphDriverName: "vfs",
83 GraphDriverOptions: options,
84 UIDMap: Transport.DefaultUIDMap(),
85 GIDMap: Transport.DefaultGIDMap(),
86 })
87 if err != nil {
88 t.Fatal(err)
89 }
90 Transport.SetStore(store)
91 return store
92}
93
94func newStore(t *testing.T) storage.Store {
95 return newStoreWithGraphDriverOptions(t, []string{})

Callers 2

newStoreFunction · 0.85

Calls 6

GetStoreMethod · 0.80
SetDefaultUIDMapMethod · 0.65
SetDefaultGIDMapMethod · 0.65
DefaultUIDMapMethod · 0.65
DefaultGIDMapMethod · 0.65
SetStoreMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…