forked from LaconicNetwork/kompose
Merge pull request #77 from janetkuo/rw-default
Volumes default not read-only
This commit is contained in:
commit
c618bc7c64
@ -515,12 +515,12 @@ func configVolumes(service ServiceConfig) ([]api.VolumeMount, []api.Volume) {
|
|||||||
containerDir := volume[strings.Index(volume, character)+1:]
|
containerDir := volume[strings.Index(volume, character)+1:]
|
||||||
containerDir = strings.TrimSpace(containerDir)
|
containerDir = strings.TrimSpace(containerDir)
|
||||||
|
|
||||||
// check if ro/rw mode is defined
|
// check if ro/rw mode is defined, default rw
|
||||||
readonly := true
|
readonly := false
|
||||||
if strings.Index(volume, character) != strings.LastIndex(volume, character) {
|
if strings.Index(volume, character) != strings.LastIndex(volume, character) {
|
||||||
mode := volume[strings.LastIndex(volume, character)+1:]
|
mode := volume[strings.LastIndex(volume, character)+1:]
|
||||||
if strings.Compare(mode, "rw") == 0 {
|
if strings.Compare(mode, "ro") == 0 {
|
||||||
readonly = false
|
readonly = true
|
||||||
}
|
}
|
||||||
containerDir = containerDir[0:strings.Index(containerDir, character)]
|
containerDir = containerDir[0:strings.Index(containerDir, character)]
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user