From b943f65bae6d5f84f7659d96ab5cd31c1e83facd Mon Sep 17 00:00:00 2001 From: Joseph Vazhappilly Date: Tue, 4 Feb 2020 14:05:08 +0530 Subject: [PATCH] Fix incorrect use of AttachStatus --- pkg/api/util/db.go | 2 +- pkg/model/volume.go | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/api/util/db.go b/pkg/api/util/db.go index ead9cb66c..496734bc7 100644 --- a/pkg/api/util/db.go +++ b/pkg/api/util/db.go @@ -890,7 +890,7 @@ func DeleteVolumeGroupDBEntry(ctx *c.Context, volumeGroupId string) error { var volumesUpdate []*model.VolumeSpec for _, value := range volumes { - if value.AttachStatus == model.VolumeAttached { + if value.Status == model.VolumeInUse { msg := fmt.Sprintf("volume %s in group %s is attached. Need to deach first.", value.Id, vg.Id) log.Error(msg) return errors.New(msg) diff --git a/pkg/model/volume.go b/pkg/model/volume.go index e2488ecd4..802e5091d 100755 --- a/pkg/model/volume.go +++ b/pkg/model/volume.go @@ -75,8 +75,6 @@ type VolumeSpec struct { // The uuid of the replication which the volume belongs to. ReplicationDriverData map[string]string `json:"replicationDriverData,omitempty"` - // Attach status of the volume. - AttachStatus string // Whether the volume can be attached more than once, default value is false. MultiAttach bool `json:"multiAttach,omitempty"`