From d5e52965c08bb408afec38b7c9ae463146870de8 Mon Sep 17 00:00:00 2001 From: bill-rich Date: Wed, 26 Aug 2020 16:19:57 -0700 Subject: [PATCH] Keep status chan open Small OVFs result in the status chan being closed before 'finished' signal can be sent. --- vsphere/internal/helper/ovfdeploy/ovf_helper.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/vsphere/internal/helper/ovfdeploy/ovf_helper.go b/vsphere/internal/helper/ovfdeploy/ovf_helper.go index e73e77446..e1bc207a9 100644 --- a/vsphere/internal/helper/ovfdeploy/ovf_helper.go +++ b/vsphere/internal/helper/ovfdeploy/ovf_helper.go @@ -78,10 +78,7 @@ func DeployOvfAndGetResult(ovfCreateImportSpecResult *types.OvfCreateImportSpecR if totalBytes == 0 { break } - progress = getTotalBytesRead(&currBytesRead) * 100 / totalBytes - if progress == 100 { - close(statusChannel) - } + progress = (getTotalBytesRead(&currBytesRead) / totalBytes) * 100 nfcLease.Progress(context.Background(), int32(progress)) time.Sleep(10 * time.Second) }