Skip to content

Commit

Permalink
Make OSDiskSizeGB actually optional
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmey committed Jun 3, 2019
1 parent 7b6ed8c commit 2e07c84
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions builder/azure/chroot/step_create_new_disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var _ multistep.Step = &StepCreateNewDisk{}

type StepCreateNewDisk struct {
SubscriptionID, ResourceGroup, DiskName string
DiskSizeGB int32
DiskSizeGB int32 // optional, ignored if 0
DiskStorageAccountType string
HyperVGeneration string
Location string
Expand Down Expand Up @@ -46,10 +46,14 @@ func (s StepCreateNewDisk) Run(ctx context.Context, state multistep.StateBag) mu
OsType: "Linux",
HyperVGeneration: compute.HyperVGeneration(s.HyperVGeneration),
CreationData: &compute.CreationData{},
DiskSizeGB: to.Int32Ptr(s.DiskSizeGB),
},
//Tags: map[string]*string{
}

if s.DiskSizeGB > 0 {
disk.DiskProperties.DiskSizeGB = to.Int32Ptr(s.DiskSizeGB)
}

if s.PlatformImage == nil {
disk.CreationData.CreateOption = compute.Empty
} else {
Expand Down

0 comments on commit 2e07c84

Please sign in to comment.