mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 18:53:35 +00:00
cephfs: subvolumes 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
cf97e377fa
commit
14d6211d6d
@ -93,6 +93,10 @@ func (s *subVolumeClient) removeMetadata(key string) error {
|
||||
|
||||
// SetAllMetadata set all the metadata from arg parameters on Ssubvolume.
|
||||
func (s *subVolumeClient) SetAllMetadata(parameters map[string]string) error {
|
||||
if !s.enableMetadata {
|
||||
return nil
|
||||
}
|
||||
|
||||
for k, v := range parameters {
|
||||
err := s.setMetadata(k, v)
|
||||
if err != nil {
|
||||
@ -113,6 +117,10 @@ func (s *subVolumeClient) SetAllMetadata(parameters map[string]string) error {
|
||||
|
||||
// UnsetAllMetadata unset all the metadata from arg keys on subvolume.
|
||||
func (s *subVolumeClient) UnsetAllMetadata(keys []string) error {
|
||||
if !s.enableMetadata {
|
||||
return nil
|
||||
}
|
||||
|
||||
for _, key := range keys {
|
||||
err := s.removeMetadata(key)
|
||||
// TODO: replace string comparison with errno.
|
||||
|
Reference in New Issue
Block a user