Bug 1563070 - PV and PVC could be bound with different accessMode
Summary: PV and PVC could be bound with different accessMode
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Storage
Version: 3.7.1
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 3.7.z
Assignee: Bradley Childs
QA Contact: Jianwei Hou
URL:
Whiteboard:
Depends On: 1535277
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-04-03 06:30 UTC by Qin Ping
Modified: 2018-04-04 10:07 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1535277
Environment:
Last Closed: 2018-04-04 10:07:21 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0489 0 None None None 2018-04-03 06:30:26 UTC

Description Qin Ping 2018-04-03 06:30:26 UTC
This issue was found in OCP:
openshift v3.7.42
kubernetes v1.7.6+a08f5eeb62

+++ This bug was initially created as a clone of Bug #1535277 +++

Description of problem:
Block volumeMode PVC prebound a Block volumeMode PV, but with different accessMode bound successfully.

Version-Release number of selected component (if applicable):
oc v3.9.0-0.20.0
openshift v3.9.0-0.20.0
kubernetes v1.9.1+a0ce1bc657


How reproducible:
Always

Steps to Reproduce:
1. Create a Block volumeMode PV with accessMode ReadWriteOnce
2. Create a Block volumeMode PVC prebound the PV created above with accessMode ReadWriteMany
3. Check the PVC and PV

Actual results:
PVC is bound to PV

Expected results:
PVC is not bound to PV

Additional info:
When PVC is not prebound to PV, PVC will not be bound to PV.

# cat pv-block.yaml 
apiVersion: v1
kind: PersistentVolume
metadata:
  name: block-pv
spec:
  capacity:
    storage: 5Gi
  accessModes:
    - ReadWriteOnce
  volumeMode: Block
  persistentVolumeReclaimPolicy: Retain
  fc:
    targetWWNs: ["500a0981891b8dc5", "500a0981991b8dc5"]
    lun: 2
    readOnly: false

# cat pvc-block.json 
{
    "apiVersion": "v1",
    "kind": "PersistentVolumeClaim",
    "metadata": {
        "name": "claim-block"
    },
    "spec": {
        "accessModes": [ "ReadWriteMany" ],
        "volumeMode" : "Block",
        "volumeName" : "block-pv",
        "resources": {
            "requests": {
                "storage": "5Gi"
            }
        }
    }
}

# oc get pvc
NAME          STATUS    VOLUME     CAPACITY   ACCESS MODES   STORAGECLASS   AGE
claim-block   Bound     block-pv   5Gi        RWO                           1m

# oc get pvc -o yaml
apiVersion: v1
items:
- apiVersion: v1
  kind: PersistentVolumeClaim
  metadata:
    annotations:
      pv.kubernetes.io/bind-completed: "yes"
    creationTimestamp: 2018-01-17T01:55:48Z
    name: claim-block
    namespace: piqin
    resourceVersion: "63560"
    selfLink: /api/v1/namespaces/piqin/persistentvolumeclaims/claim-block
    uid: 89bafef7-fb29-11e7-8435-9457a56bf834
  spec:
    accessModes:
    - ReadWriteMany
    resources:
      requests:
        storage: 5Gi
    volumeMode: Block
    volumeName: block-pv
  status:
    accessModes:
    - ReadWriteOnce
    capacity:
      storage: 5Gi
    phase: Bound
kind: List
metadata:
  resourceVersion: ""
  selfLink: ""

Comment 1 Jan Safranek 2018-04-04 10:07:21 UTC
IMO, it's not serious enough to fix it in all old releases. 3.9 is just behind the door and it's fixed there.


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