Skip to content

Commit

Permalink
[chore][fix] fix condition to delete volume
Browse files Browse the repository at this point in the history
  • Loading branch information
cuongpiger committed Jul 1, 2024
1 parent 04b0a43 commit 87b39a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vngcloud/entity/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ func (s *Volume) IsInUse() bool {
}

func (s *Volume) CanDelete() bool {
if len(s.AttachedMachine) < 1 && s.VmId == "" {
if len(s.AttachedMachine) < 1 && s.VmId == "" && s.Status == "AVAILABLE" {
return true
}

if s.Status == "AVAILABLE" || s.Status == "ERROR" {
if s.Status == "ERROR" {
return true
}

Expand Down

0 comments on commit 87b39a2

Please sign in to comment.