mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 02:43:36 +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
@ -91,6 +91,10 @@ func (s *snapshotClient) removeSnapshotMetadata(key string) error {
|
||||
// SetAllSnapshotMetadata set all the metadata from arg parameters on
|
||||
// subvolume snapshot.
|
||||
func (s *snapshotClient) SetAllSnapshotMetadata(parameters map[string]string) error {
|
||||
if !s.enableMetadata {
|
||||
return nil
|
||||
}
|
||||
|
||||
for k, v := range parameters {
|
||||
err := s.setSnapshotMetadata(k, v)
|
||||
if err != nil {
|
||||
@ -113,6 +117,10 @@ func (s *snapshotClient) SetAllSnapshotMetadata(parameters map[string]string) er
|
||||
// UnsetAllSnapshotMetadata unset all the metadata from arg keys on subvolume
|
||||
// snapshot.
|
||||
func (s *snapshotClient) UnsetAllSnapshotMetadata(keys []string) error {
|
||||
if !s.enableMetadata {
|
||||
return nil
|
||||
}
|
||||
|
||||
for _, key := range keys {
|
||||
err := s.removeSnapshotMetadata(key)
|
||||
// TODO: replace string comparison with errno.
|
||||
|
Reference in New Issue
Block a user