Added unit tests for each PV using IsReadOnly

This commit is contained in:
markturansky
2015-07-01 10:50:39 -04:00
parent fae6759490
commit 63ccfa2beb
10 changed files with 338 additions and 15 deletions

View File

@@ -76,11 +76,13 @@ func (plugin *nfsPlugin) NewBuilder(spec *volume.Spec, pod *api.Pod, _ volume.Vo
func (plugin *nfsPlugin) newBuilderInternal(spec *volume.Spec, pod *api.Pod, mounter mount.Interface) (volume.Builder, error) {
var source *api.NFSVolumeSource
var readOnly bool
if spec.VolumeSource.NFS != nil {
source = spec.VolumeSource.NFS
readOnly = spec.VolumeSource.NFS.ReadOnly
} else {
source = spec.PersistentVolumeSource.NFS
readOnly = spec.ReadOnly
}
return &nfsBuilder{
nfs: &nfs{
@@ -91,7 +93,8 @@ func (plugin *nfsPlugin) newBuilderInternal(spec *volume.Spec, pod *api.Pod, mou
},
server: source.Server,
exportPath: source.Path,
readOnly: source.ReadOnly}, nil
readOnly: readOnly,
}, nil
}
func (plugin *nfsPlugin) NewCleaner(volName string, podUID types.UID, mounter mount.Interface) (volume.Cleaner, error) {