Skip to content

Commit

Permalink
Merge pull request #214 from Rakshith-R/BZ-2249600
Browse files Browse the repository at this point in the history
BUG 2249600: cephfs: set Pool parameter to empty for Snapshot-backed volumes
  • Loading branch information
openshift-merge-bot[bot] authored Nov 14, 2023
2 parents 88078ee + 9546818 commit 27a450f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions e2e/cephfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ var (
cephFSExamplePath = examplePath + "cephfs/"
subvolumegroup = "e2e"
fileSystemName = "myfs"
fileSystemPoolName = "myfs-replicated"
)

func deployCephfsPlugin() {
Expand Down Expand Up @@ -1613,6 +1614,7 @@ var _ = Describe(cephfsType, func() {
scOpts := map[string]string{
"encrypted": "true",
"encryptionKMSID": kmsID,
"pool": fileSystemPoolName,
}

err = createCephfsStorageClass(f.ClientSet, f, true, scOpts)
Expand Down
7 changes: 4 additions & 3 deletions internal/cephfs/store/volumeoptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -542,9 +542,10 @@ func (vo *VolumeOptions) populateVolumeOptionsFromBackingSnapshot(
return fmtBackingSnapshotOptionMismatch("clusterID", vo.ClusterID, parentBackingSnapVolOpts.ClusterID)
}

if vo.Pool != "" {
return errors.New("cannot set pool for snapshot-backed volume")
}
// Pool parameter is optional and only used to set 'pool_layout' argument for
// 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 {
return fmtBackingSnapshotOptionMismatch("MetadataPool", vo.MetadataPool, parentBackingSnapVolOpts.MetadataPool)
Expand Down

0 comments on commit 27a450f

Please sign in to comment.