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

Function WithScratchFile

plugins/snapshots/blockfile/blockfile.go:70–80  ·  view source on GitHub ↗

WithScratchFile provides a scratch file which will get copied on startup if the scratch file needs to be generated.

(src string)

Source from the content-addressed store, hash-verified

68// WithScratchFile provides a scratch file which will get copied on startup
69// if the scratch file needs to be generated.
70func WithScratchFile(src string) Opt {
71 return func(root string, config *SnapshotterConfig) {
72 config.scratchGenerator = func(dst string) error {
73 // Copy src to dst
74 if err := copyFileWithSync(dst, src); err != nil {
75 return fmt.Errorf("failed to copy scratch: %w", err)
76 }
77 return nil
78 }
79 }
80}
81
82// WithFSType defines the filesystem type to apply to mounts of the blockfile
83func WithFSType(fsType string) Opt {

Callers 2

initFunction · 0.92
setupSnapshotterFunction · 0.85

Calls 1

copyFileWithSyncFunction · 0.85

Tested by 1

setupSnapshotterFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…