mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
4f0d95fa6e
Signed-off-by: Daniel Nephin <dnephin@docker.com>
23 lines
517 B
Go
23 lines
517 B
Go
package volume // import "github.com/docker/docker/volume"
|
|
|
|
import "strings"
|
|
|
|
// {<copy mode>=isEnabled}
|
|
var copyModes = map[string]bool{
|
|
"nocopy": false,
|
|
}
|
|
|
|
func copyModeExists(mode string) bool {
|
|
_, exists := copyModes[mode]
|
|
return exists
|
|
}
|
|
|
|
// GetCopyMode gets the copy mode from the mode string for mounts
|
|
func getCopyMode(mode string, def bool) (bool, bool) {
|
|
for _, o := range strings.Split(mode, ",") {
|
|
if isEnabled, exists := copyModes[o]; exists {
|
|
return isEnabled, true
|
|
}
|
|
}
|
|
return def, false
|
|
}
|