MCPcopy Index your code
hub / github.com/containerd/containerd / WithReadonlyTempMount

Function WithReadonlyTempMount

core/mount/temp.go:137–139  ·  view source on GitHub ↗

WithReadonlyTempMount mounts the provided mounts to a temp dir as readonly, and pass the temp dir to f. The mounts are valid during the call to the f. Finally we will unmount and remove the temp dir regardless of the result of f.

(ctx context.Context, mounts []Mount, f func(root string) error)

Source from the content-addressed store, hash-verified

135// and pass the temp dir to f. The mounts are valid during the call to the f.
136// Finally we will unmount and remove the temp dir regardless of the result of f.
137func WithReadonlyTempMount(ctx context.Context, mounts []Mount, f func(root string) error) (err error) {
138 return WithTempMount(ctx, readonlyMounts(mounts), f)
139}
140
141func getTempDir() string {
142 if xdg := os.Getenv("XDG_RUNTIME_DIR"); xdg != "" {

Callers 2

withReadonlyFSFunction · 0.92
CompareMethod · 0.92

Calls 2

WithTempMountFunction · 0.85
readonlyMountsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…