WithScratchFile provides a scratch file which will get copied on startup if the scratch file needs to be generated.
(src string)
| 68 | // WithScratchFile provides a scratch file which will get copied on startup |
| 69 | // if the scratch file needs to be generated. |
| 70 | func 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 |
| 83 | func WithFSType(fsType string) Opt { |
searching dependent graphs…