mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-22 06:10:22 +00:00
cephfs: set Pool parameter to empty for Snapshot-backed volumes
Set VolumeOptions.Pool parameter to empty for Snapshot-backed volumes. This Pool parameter is optional and only used as 'pool-layout' parameter during subvolume and subvolume clone create request in cephcsi and not used for Snapshot-backed volume at all. It is not saved anywhere for use in subsequent operations after create too. Therefore, We can set it to empty and not error out. Signed-off-by: rakshith-r <rar@redhat.com>
This commit is contained in:
parent
f3fca46ac8
commit
f1e9d8084a
@ -44,6 +44,7 @@ var (
|
|||||||
cephFSExamplePath = examplePath + "cephfs/"
|
cephFSExamplePath = examplePath + "cephfs/"
|
||||||
subvolumegroup = "e2e"
|
subvolumegroup = "e2e"
|
||||||
fileSystemName = "myfs"
|
fileSystemName = "myfs"
|
||||||
|
fileSystemPoolName = "myfs-replicated"
|
||||||
)
|
)
|
||||||
|
|
||||||
func deployCephfsPlugin() {
|
func deployCephfsPlugin() {
|
||||||
@ -1613,6 +1614,7 @@ var _ = Describe(cephfsType, func() {
|
|||||||
scOpts := map[string]string{
|
scOpts := map[string]string{
|
||||||
"encrypted": "true",
|
"encrypted": "true",
|
||||||
"encryptionKMSID": kmsID,
|
"encryptionKMSID": kmsID,
|
||||||
|
"pool": fileSystemPoolName,
|
||||||
}
|
}
|
||||||
|
|
||||||
err = createCephfsStorageClass(f.ClientSet, f, true, scOpts)
|
err = createCephfsStorageClass(f.ClientSet, f, true, scOpts)
|
||||||
|
@ -542,9 +542,10 @@ func (vo *VolumeOptions) populateVolumeOptionsFromBackingSnapshot(
|
|||||||
return fmtBackingSnapshotOptionMismatch("clusterID", vo.ClusterID, parentBackingSnapVolOpts.ClusterID)
|
return fmtBackingSnapshotOptionMismatch("clusterID", vo.ClusterID, parentBackingSnapVolOpts.ClusterID)
|
||||||
}
|
}
|
||||||
|
|
||||||
if vo.Pool != "" {
|
// Pool parameter is optional and only used to set 'pool_layout' argument for
|
||||||
return errors.New("cannot set pool for snapshot-backed volume")
|
// subvolume and subvolume clone create commands.
|
||||||
}
|
// Setting this to empty since it is not used with Snapshot-backed volume.
|
||||||
|
vo.Pool = ""
|
||||||
|
|
||||||
if vo.MetadataPool != parentBackingSnapVolOpts.MetadataPool {
|
if vo.MetadataPool != parentBackingSnapVolOpts.MetadataPool {
|
||||||
return fmtBackingSnapshotOptionMismatch("MetadataPool", vo.MetadataPool, parentBackingSnapVolOpts.MetadataPool)
|
return fmtBackingSnapshotOptionMismatch("MetadataPool", vo.MetadataPool, parentBackingSnapVolOpts.MetadataPool)
|
||||||
|
Loading…
Reference in New Issue
Block a user