Bug 1264814

Summary: Users have write access when the nfs volume accessmode is only ROX
Product: OKD Reporter: Chao Yang <chaoyang>
Component: StorageAssignee: Mark Turansky <mturansk>
Status: CLOSED NOTABUG QA Contact: Liang Xia <lxia>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.xCC: aos-bugs, xtian
Target Milestone: ---Keywords: NeedsTestCase
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-10-27 15:37:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Chao Yang 2015-09-21 09:35:07 UTC
Description of problem:
Users have write access when the nfs volume accessmode is only ROX

Version-Release number of selected component (if applicable):
oc v1.0.6-86-gfc46484
kubernetes v1.1.0-alpha.0-1605-g44c91b1

How reproducible:

always
Steps to Reproduce:
1. create pv with accessmode is ROX
oc get pv
NAME      LABELS    CAPACITY   ACCESSMODES   STATUS    CLAIM               REASON    AGE
nfs1      <none>    10Gi       ROX           Bound     default/myclaim-1             3d

2. create pvc with accessmode is ROX
oc get pvc
NAME        LABELS    STATUS    VOLUME    CAPACITY   ACCESSMODES   AGE
myclaim-1   <none>    Bound     nfs1      10Gi       ROX           3d

3.write some data on the mounted dir
oc exec nfs -ti -- bash
[root@nfs /]# cd /mnt
[root@nfs mnt]# ls
nfs
[root@nfs mnt]# cd nfs/

[root@nfs nfs]# ls
hi  next  test    world
[root@nfs nfs]# touch yes
[root@nfs nfs]# ls
hi  next  test    world  yes

Actual results:
users can wirte to the mounted dir even if the volume access mode is only ROX

Expected results:
users should not write to the mounted dir when the volume access mode is ROX

Additional info:

Comment 1 Mark Turansky 2015-09-23 15:09:21 UTC
this is not a bug.

A volume has all the capabilities of the underlying storage provider.  NFS allows many clients to read/write.

Comment 2 Chao Yang 2015-09-24 07:15:59 UTC
If pvc only request ROX, also can write to the volume? no restriction for the PVC?

Comment 3 Mark Turansky 2015-09-24 14:35:14 UTC
That is correct.

The volume *supports* ROX but does not *enforce* ROX if that's what the PVC requests.