(ctx context.Context, mounts []mount.Mount, r io.Reader, _sync bool)
| 28 | ) |
| 29 | |
| 30 | func 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 | } |
no test coverage detected
searching dependent graphs…