mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
daemon: move sortMounts to a platform-agnostic file
The same code was used both on Linux and Windows; move it to a platform- agnostic file so that both can use this function, which contains GoDoc describing the functionality. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -6,7 +6,6 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
@@ -121,14 +120,6 @@ func (daemon *Daemon) setupMounts(ctx context.Context, c *container.Container) (
|
||||
return append(mounts, netMounts...), cleanups.Release(), nil
|
||||
}
|
||||
|
||||
// sortMounts sorts an array of mounts in lexicographic order. This ensure that
|
||||
// when mounting, the mounts don't shadow other mounts. For example, if mounting
|
||||
// /etc and /etc/resolv.conf, /etc/resolv.conf must not be mounted first.
|
||||
func sortMounts(m []container.Mount) []container.Mount {
|
||||
sort.Sort(mounts(m))
|
||||
return m
|
||||
}
|
||||
|
||||
// setBindModeIfNull is platform specific processing to ensure the
|
||||
// shared mode is set to 'z' if it is null. This is called in the case
|
||||
// of processing a named volume and not a typical bind.
|
||||
|
||||
Reference in New Issue
Block a user