diff --git a/cmd/volume/volume_list.go b/cmd/volume/volume_list.go index c04cf865..e1a4f276 100644 --- a/cmd/volume/volume_list.go +++ b/cmd/volume/volume_list.go @@ -85,7 +85,18 @@ Example: civo volume ls -o custom -f "ID: Name (SizeGigabytes)`, return volumes[i].Name < volumes[j].Name }) - utility.Info("Volumes with status 'dangling' mean they are attached to a cluster that no longer exists. You can attach them to an instance, or delete them if they are no longer needed.") + hasDanglingVolumes := false + for _, volume := range volumes { + if volume.Status == "dangling" { + hasDanglingVolumes = true + break + } + } + + if hasDanglingVolumes { + utility.Info("Volumes with status 'dangling' mean they are attached to a cluster that no longer exists. You can attach them to an instance, or delete them if they are no longer needed.") + } + for _, volume := range volumes { ow.StartLine() ow.AppendDataWithLabel("id", volume.ID, "ID")