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:
Prasanna Kumar Kalever
2022-07-28 17:56:55 +05:30
committed by mergify[bot]
parent 14d6211d6d
commit 30244bf11b
6 changed files with 35 additions and 32 deletions

View File

@ -61,10 +61,11 @@ type SnapshotClient interface {
// snapshotClient is the implementation of SnapshotClient interface.
type snapshotClient struct {
*Snapshot // Embedded snapshot struct.
clusterID string // Cluster ID.
clusterName string // Cluster Name.
conn *util.ClusterConnection // Cluster connection.
*Snapshot // Embedded snapshot struct.
clusterID string // Cluster ID.
clusterName string // Cluster Name.
enableMetadata bool // Set metadata on volume
conn *util.ClusterConnection // Cluster connection.
}
// Snapshot represents a subvolume snapshot and its cluster information.
@ -79,6 +80,7 @@ func NewSnapshot(
snapshotID,
clusterID,
clusterName string,
setMetadata bool,
vol *SubVolume,
) SnapshotClient {
return &snapshotClient{
@ -86,9 +88,10 @@ func NewSnapshot(
SnapshotID: snapshotID,
SubVolume: vol,
},
clusterID: clusterID,
clusterName: clusterName,
conn: conn,
clusterID: clusterID,
clusterName: clusterName,
enableMetadata: setMetadata,
conn: conn,
}
}