mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
cephfs: snapshots honor --setmetadata
option
`--setmetadata` is false by default, honoring it will keep the metadata disabled by default Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
14d6211d6d
commit
30244bf11b
@ -379,6 +379,7 @@ func CheckSnapExists(
|
||||
volOptions *VolumeOptions,
|
||||
snap *SnapshotOption,
|
||||
clusterName string,
|
||||
setMetadata bool,
|
||||
cr *util.Credentials,
|
||||
) (*SnapshotIdentifier, *core.SnapshotInfo, error) {
|
||||
// Connect to cephfs' default radosNamespace (csi)
|
||||
@ -400,7 +401,8 @@ func CheckSnapExists(
|
||||
snapUUID := snapData.ImageUUID
|
||||
snapID := snapData.ImageAttributes.ImageName
|
||||
sid.FsSnapshotName = snapData.ImageAttributes.ImageName
|
||||
snapClient := core.NewSnapshot(volOptions.conn, snapID, volOptions.ClusterID, clusterName, &volOptions.SubVolume)
|
||||
snapClient := core.NewSnapshot(volOptions.conn, snapID,
|
||||
volOptions.ClusterID, clusterName, setMetadata, &volOptions.SubVolume)
|
||||
snapInfo, err := snapClient.GetSnapshotInfo(ctx)
|
||||
if err != nil {
|
||||
if errors.Is(err, cerrors.ErrSnapNotFound) {
|
||||
|
@ -749,7 +749,7 @@ func NewSnapshotOptionsFromID(
|
||||
volOptions.Size = subvolInfo.BytesQuota
|
||||
volOptions.RootPath = subvolInfo.Path
|
||||
snap := core.NewSnapshot(volOptions.conn, sid.FsSnapshotName,
|
||||
volOptions.ClusterID, clusterName, &volOptions.SubVolume)
|
||||
volOptions.ClusterID, clusterName, setMetadata, &volOptions.SubVolume)
|
||||
info, err := snap.GetSnapshotInfo(ctx)
|
||||
if err != nil {
|
||||
return &volOptions, nil, &sid, err
|
||||
|
Reference in New Issue
Block a user