MCPcopy
hub / github.com/containerd/containerd / apply

Function apply

core/diff/apply/apply_other.go:30–51  ·  view source on GitHub ↗
(ctx context.Context, mounts []mount.Mount, r io.Reader, _sync bool)

Source from the content-addressed store, hash-verified

28)
29
30func apply(ctx context.Context, mounts []mount.Mount, r io.Reader, _sync bool) error {
31 // TODO: for windows, how to sync?
32
33 if !mount.HasBindMounts && len(mounts) == 1 && mounts[0].Type == "bind" {
34 opts := []archive.ApplyOpt{}
35
36 if os.Getuid() != 0 {
37 opts = append(opts, archive.WithNoSameOwner())
38 }
39
40 path := mounts[0].Source
41 _, err := archive.Apply(ctx, path, r, opts...)
42 return err
43
44 // TODO: Do we need to sync all the filesystems?
45 }
46
47 return mount.WithTempMount(ctx, mounts, func(root string) error {
48 _, err := archive.Apply(ctx, root, r)
49 return err
50 })
51}

Callers 1

ApplyMethod · 0.70

Calls 3

WithNoSameOwnerFunction · 0.92
ApplyFunction · 0.92
WithTempMountFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…