Skip to content

Commit

Permalink
cephfs: set Pool parameter to empty for Snapshot-backed volumes
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Rakshith-R committed Aug 9, 2023
1 parent 874d0bc commit 4ec5e0a
Showing 1 changed file with 4 additions and 3 deletions.
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 parameters 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 4ec5e0a

Please sign in to comment.