MCPcopy
hub / github.com/containerd/containerd / writeDiff

Function writeDiff

plugins/diff/erofs/compare_linux.go:44–55  ·  view source on GitHub ↗
(ctx context.Context, w io.Writer, lower []mount.Mount, upperRoot string)

Source from the content-addressed store, hash-verified

42)
43
44func writeDiff(ctx context.Context, w io.Writer, lower []mount.Mount, upperRoot string) error {
45 var opts []archive.ChangeWriterOpt
46
47 return mount.WithTempMount(ctx, lower, func(lowerRoot string) error {
48 cw := archive.NewChangeWriter(w, upperRoot, opts...)
49 err := fs.DiffDirChanges(ctx, lowerRoot, upperRoot, fs.DiffSourceOverlayFS, cw.HandleChange)
50 if err != nil {
51 return fmt.Errorf("failed to create diff tar stream: %w", err)
52 }
53 return cw.Close()
54 })
55}
56
57// Compare creates a diff between the given mounts and uploads the result
58// to the content store.

Callers 1

CompareMethod · 0.85

Calls 3

CloseMethod · 0.95
WithTempMountFunction · 0.92
NewChangeWriterFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…