IsReadOnly bool on builder

This commit is contained in:
markturansky
2015-06-29 12:54:43 -04:00
parent 124bb22f92
commit fae6759490
15 changed files with 118 additions and 6 deletions

View File

@@ -99,7 +99,7 @@ func (plugin *glusterfsPlugin) newBuilderInternal(spec *volume.Spec, ep *api.End
},
hosts: ep,
path: source.Path,
readonly: readOnly,
readOnly: readOnly,
exe: exe}, nil
}
@@ -128,7 +128,8 @@ type glusterfsBuilder struct {
*glusterfs
hosts *api.Endpoints
path string
readonly bool
readOnly bool
mounter mount.Interface
exe exec.Interface
}
@@ -161,6 +162,10 @@ func (b *glusterfsBuilder) SetUpAt(dir string) error {
return err
}
func (glusterfsVolume *glusterfs) IsReadOnly() bool {
return glusterfsVolume.readOnly
}
func (glusterfsVolume *glusterfs) GetPath() string {
name := glusterfsPluginName
return glusterfsVolume.plugin.host.GetPodVolumeDir(glusterfsVolume.pod.UID, util.EscapeQualifiedNameForDisk(name), glusterfsVolume.volName)
@@ -212,7 +217,7 @@ func (b *glusterfsBuilder) setUpAtInternal(dir string) error {
var errs error
options := []string{}
if b.readonly {
if glusterfsVolume.readOnly {
options = append(options, "ro")
}