From f2e77a76a8594b5306814a476c00069c97a04150 Mon Sep 17 00:00:00 2001 From: Ian Eyberg Date: Fri, 24 Dec 2021 07:54:50 -0800 Subject: [PATCH] allow empty azure volumes to be set to arbitrary large sizes (#1213) Co-authored-by: Ian Eyberg --- azure/azure_volume.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/azure/azure_volume.go b/azure/azure_volume.go index 7a182493..2a0610a3 100644 --- a/azure/azure_volume.go +++ b/azure/azure_volume.go @@ -26,9 +26,14 @@ func (a *Azure) CreateVolume(ctx *lepton.Context, name, data, provider string) ( location := a.getLocation(config) - sizeInGb, err := lepton.GetSizeInGb(config.BaseVolumeSz) - if err != nil { - return vol, err + var sizeInGb int64 + if config.BaseVolumeSz != "" { + size, err := lepton.GetSizeInGb(config.BaseVolumeSz) + if err != nil { + return vol, fmt.Errorf("cannot get volume size: %v", err) + } + config.BaseVolumeSz = "" // create minimum-sized local volume + sizeInGb = int64(size) } vol, err = lepton.CreateLocalVolume(config, name, data, provider)