From d4fcbde56dc30fa6b977098c81837472eae355bc Mon Sep 17 00:00:00 2001 From: TangBin Date: Tue, 30 Oct 2018 17:13:57 +0800 Subject: [PATCH] bugfix --- pkg/util/aws/image.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/util/aws/image.go b/pkg/util/aws/image.go index 55a4d73f3d..ef789d2a99 100644 --- a/pkg/util/aws/image.go +++ b/pkg/util/aws/image.go @@ -203,7 +203,7 @@ func (self *SRegion) GetImageStatus(imageId string) (ImageStatusType, error) { func getRootDiskSize(image *ec2.Image) (int, error) { rootDeivce := *image.RootDeviceName for _, volume := range image.BlockDeviceMappings { - if *volume.DeviceName == rootDeivce { + if len(rootDeivce) > 0 && *volume.DeviceName == rootDeivce { return int(*volume.Ebs.VolumeSize), nil } }