mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-17 20:00:23 +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
|
||||
}
|
||||
|
||||
// String makes it easy to include the volumeGroup object in log and error
|
||||
// messages.
|
||||
// String returns the image-spec (pool/{namespace}/{name}) format of the group.
|
||||
func (vg *volumeGroup) String() string {
|
||||
if vg.name != "" {
|
||||
return vg.name
|
||||
if vg.namespace != "" && vg.pool != "" && vg.name != "" {
|
||||
return fmt.Sprintf("%s/%s/%s", vg.pool, vg.namespace, vg.name)
|
||||
}
|
||||
|
||||
if vg.id != "" {
|
||||
return vg.id
|
||||
if vg.name != "" && vg.pool != "" {
|
||||
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.
|
||||
|
Loading…
Reference in New Issue
Block a user