Bug 1366500 - Prebound pv should be bound to pvc and ignore of mismatched accessmode
Summary: Prebound pv should be bound to pvc and ignore of mismatched accessmode
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Storage
Version: 3.3.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Matthew Wong
QA Contact: Jianwei Hou
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-12 06:59 UTC by Chao Yang
Modified: 2016-08-16 17:18 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-08-16 17:18:58 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Chao Yang 2016-08-12 06:59:44 UTC
Description of problem:
If a PV contains a ClaimRef, accessmode should be ignored

Version-Release number of selected component (if applicable):
openshift v3.3.0.18
kubernetes v1.3.0+507d3a7
etcd 2.3.0+git


How reproducible:
Always

Steps to Reproduce:
1.Create a pv with accessmode RWO prebound to pvc 
2.Create a pvc with accessmode RWX
3.Check pv and pvc status
oc get pv nfs1 -o yaml
apiVersion: v1
kind: PersistentVolume
metadata:
  creationTimestamp: 2016-08-12T05:44:03Z
  name: nfs1
  resourceVersion: "6187"
  selfLink: /api/v1/persistentvolumes/nfs1
  uid: c6f2f30e-604f-11e6-8d03-fa163e2d8f92
spec:
  accessModes:
  - ReadWriteOnce
  capacity:
    storage: 1Gi
  claimRef:
    name: nfsclaim1
    namespace: default
  nfs:
    path: /chaotest
    server: 10.14.6.144
  persistentVolumeReclaimPolicy: Retain
status:
  phase: Available

oc get pvc nfsclaim1 -o yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  creationTimestamp: 2016-08-12T05:44:09Z
  name: nfsclaim1
  namespace: default
  resourceVersion: "6218"
  selfLink: /api/v1/namespaces/default/persistentvolumeclaims/nfsclaim1
  uid: ca399877-604f-11e6-8d03-fa163e2d8f92
spec:
  accessModes:
  - ReadWriteMany
  resources:
    requests:
      storage: 1Gi
status:
  phase: Pending


Actual results:
PV is available, pvc is pending

Expected results:
PV and PVC should be bound

Additional info:
According to https://bugzilla.redhat.com/show_bug.cgi?id=1360171#c3 , PV and PVC should be bound even if the access mode is mismatch

Comment 1 Matthew Wong 2016-08-12 18:22:01 UTC
pr created here https://github.com/kubernetes/kubernetes/pull/30522

Comment 2 Eric Paris 2016-08-15 18:06:14 UTC
Do we actually want this behavior?

I disagree with the whole concept predicating this BZ. I believe that if you 'pre-bind' but the binding is invalid you should stay pending. If I create a PVC with size=1T and PV=1G but the PV says it is 'pre-bound' I think it should fail/pending.

pre-binding needs to work, but not when you are trying to make an illegal/invalid binding.

erin?

Comment 3 Erin Boyd 2016-08-16 13:53:43 UTC
I had no input to how this should function.
I will yield to the architect (@eparis) on the 'correct' behavior for this.
However you decide it should work, I will happily document in a PR I already have opened for pre-binding.

Comment 4 Matthew Wong 2016-08-16 17:18:58 UTC
It's been decided that this is correct behavior, so I will try to fix https://bugzilla.redhat.com/show_bug.cgi?id=1360171 instead so that behavior is consistent for size & modes. pr for that is here https://github.com/kubernetes/kubernetes/pull/30690


Note You need to log in before you can comment on or make changes to this bug.