Skip to content

Commit

Permalink
allow empty azure volumes to be set to arbitrary large sizes (#1213)
Browse files Browse the repository at this point in the history
Co-authored-by: Ian Eyberg <[email protected]>
  • Loading branch information
eyberg and Ian Eyberg authored Dec 24, 2021
1 parent d14cb0d commit f2e77a7
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions azure/azure_volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f2e77a7

Please sign in to comment.