Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cephfs: set Pool parameter to empty for Snapshot-backed volumes #4047

Merged
merged 1 commit into from Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions e2e/cephfs.go
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
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 = ""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should this not be the same as the pool of the original volume?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should this not be the same as the pool of the original volume?

The original volume's pool is set only for create pvc/clone cmd as pool_layout (pool is retrieved directly from pv attributes) and is not saved anywhere and not used anywhere else.

The parentBackingSnapVolOpts here does not have its pool parameter set.


if vo.MetadataPool != parentBackingSnapVolOpts.MetadataPool {
return fmtBackingSnapshotOptionMismatch("MetadataPool", vo.MetadataPool, parentBackingSnapVolOpts.MetadataPool)
Expand Down