From a85b11a6d15f0e2ffe4473e569afe08cceb327dc Mon Sep 17 00:00:00 2001 From: Kenjiro Nakayama Date: Mon, 13 Aug 2018 18:24:40 +0900 Subject: [PATCH] Construct pv from storageclass with mountOptions by rbd and cephfs provisioner This PR adds mountOptions to PV, when provisioner constructs it from storageclass. --- ceph/cephfs/cephfs-provisioner.go | 1 + ceph/rbd/pkg/provision/provision.go | 1 + 2 files changed, 2 insertions(+) diff --git a/ceph/cephfs/cephfs-provisioner.go b/ceph/cephfs/cephfs-provisioner.go index 2d6ac55cebe..6001100a21b 100644 --- a/ceph/cephfs/cephfs-provisioner.go +++ b/ceph/cephfs/cephfs-provisioner.go @@ -195,6 +195,7 @@ func (p *cephFSProvisioner) Provision(options controller.VolumeOptions) (*v1.Per Spec: v1.PersistentVolumeSpec{ PersistentVolumeReclaimPolicy: options.PersistentVolumeReclaimPolicy, AccessModes: options.PVC.Spec.AccessModes, + MountOptions: options.MountOptions, Capacity: v1.ResourceList{ // Quotas are supported by the userspace client(ceph-fuse, libcephfs), or kernel client >= 4.17 but only on mimic clusters. // In other cases capacity is meaningless here. diff --git a/ceph/rbd/pkg/provision/provision.go b/ceph/rbd/pkg/provision/provision.go index 0046d60b3c8..b528af1fc5c 100644 --- a/ceph/rbd/pkg/provision/provision.go +++ b/ceph/rbd/pkg/provision/provision.go @@ -148,6 +148,7 @@ func (p *rbdProvisioner) Provision(options controller.VolumeOptions) (*v1.Persis Spec: v1.PersistentVolumeSpec{ PersistentVolumeReclaimPolicy: options.PersistentVolumeReclaimPolicy, AccessModes: options.PVC.Spec.AccessModes, + MountOptions: options.MountOptions, Capacity: v1.ResourceList{ v1.ResourceName(v1.ResourceStorage): resource.MustParse(fmt.Sprintf("%dMi", sizeMB)), },