From 1d732e913fea5a3e7f7d9b0918d4144dfafc32f7 Mon Sep 17 00:00:00 2001 From: rainzm Date: Wed, 14 Apr 2021 18:58:07 +0800 Subject: [PATCH] fix(esxi): correctly set the imagePath outside the if block --- pkg/multicloud/esxi/host.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/multicloud/esxi/host.go b/pkg/multicloud/esxi/host.go index 57a44b516e..8223573b07 100644 --- a/pkg/multicloud/esxi/host.go +++ b/pkg/multicloud/esxi/host.go @@ -814,7 +814,8 @@ func (self *SHost) addDisks(ctx context.Context, dc *SDatacenter, ds *SDatastore size = 30 * 1024 } } else { - imagePath, err := self.FileUrlPathToDsPath(imagePath) + var err error + imagePath, err = self.FileUrlPathToDsPath(imagePath) if err != nil { return nil, errors.Wrapf(err, "SHost.FileUrlPathToDsPath") }