Skip to content

Commit

Permalink
Show dangling volume info only when required.
Browse files Browse the repository at this point in the history
  • Loading branch information
uzaxirr committed May 17, 2024
1 parent b0140da commit 8be2fcf
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion cmd/volume/volume_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 8be2fcf

Please sign in to comment.