mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-09 16:00:22 +00:00
rbd: update group Stringer method
updated the group stringer method to have pool and namespace for proper debugging/logging and to use it with CLI as agrument as well. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
parent
37970ae212
commit
f7c78ae4fe
@ -151,18 +151,17 @@ func GetVolumeGroup(
|
|||||||
return vg, nil
|
return vg, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// String makes it easy to include the volumeGroup object in log and error
|
// String returns the image-spec (pool/{namespace}/{name}) format of the group.
|
||||||
// messages.
|
|
||||||
func (vg *volumeGroup) String() string {
|
func (vg *volumeGroup) String() string {
|
||||||
if vg.name != "" {
|
if vg.namespace != "" && vg.pool != "" && vg.name != "" {
|
||||||
return vg.name
|
return fmt.Sprintf("%s/%s/%s", vg.pool, vg.namespace, vg.name)
|
||||||
}
|
}
|
||||||
|
|
||||||
if vg.id != "" {
|
if vg.name != "" && vg.pool != "" {
|
||||||
return vg.id
|
return fmt.Sprintf("%s/%s", vg.pool, vg.name)
|
||||||
}
|
}
|
||||||
|
|
||||||
return fmt.Sprintf("<unidentified volume %v>", *vg)
|
return fmt.Sprintf("<unidentified group %v>", *vg)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetID returns the CSI-Addons VolumeGroupId of the VolumeGroup.
|
// GetID returns the CSI-Addons VolumeGroupId of the VolumeGroup.
|
||||||
|
Loading…
Reference in New Issue
Block a user