2018-02-05 16:05:59 -05:00
|
|
|
package volume // import "github.com/docker/docker/volume"
|
2016-03-14 23:31:42 -04:00
|
|
|
|
|
|
|
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
|
2017-08-01 13:32:44 -04:00
|
|
|
func getCopyMode(mode string, def bool) (bool, bool) {
|
2016-03-14 23:31:42 -04:00
|
|
|
for _, o := range strings.Split(mode, ",") {
|
|
|
|
if isEnabled, exists := copyModes[o]; exists {
|
|
|
|
return isEnabled, true
|
|
|
|
}
|
|
|
|
}
|
2017-08-01 13:32:44 -04:00
|
|
|
return def, false
|
2016-03-14 23:31:42 -04:00
|
|
|
}
|