Description of problem:
Mounts created for iscsi PV's using a StorageClass with the 'discard' mount option (-o discard) are missing the setting. PV's that are created with the StorageClass include the defined mount option and are bound successfully. However, when the PV is mounted on the OpenShift node as defined by the pod spec referencing the PVC/PV, the mount options are not applied during the container creation process.
The pod shows a running status and the mount is seen and can be consumed, however it is missing the desired mount option.
How reproducible: Consistently
Actual results: 'discard' mount option is not applied to actual mount
Expected results: 'discard' option would be applied to mount
Tested with v3.11.188.
mount -t ext4 -o defaults /dev/disk/by-path/ip-10.0.148.103:3260-iscsi-iqn.2003-01.io.k8s:jsafrane-lun-0 /var/lib/origin/openshift.local.volumes/plugins/kubernetes.io/iscsi/iface-default/10.0.148.103:3260-iqn.2003-01.io.k8s:jsafrane-lun-0
(no "-o discard" !)
mount -o bind /var/lib/origin/openshift.local.volumes/plugins/kubernetes.io/iscsi/iface-default/10.0.148.103:3260-iqn.2003-01.io.k8s:
mount -o bind,remount,discard /var/lib/origin/openshift.local.volumes/plugins/kubernetes.io/iscsi/iface-default/10.0.148.103:3260-iqn
It's too late to add "discard" (or any other real option) at this point.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.