mirror of
https://github.com/hashicorp/packer.git
synced 2026-09-27 18:24:01 -04:00
Merge pull request #8975 from jhawk28/vsphereiso_disksize_fix
disk_size should not be required if storage is defined
This commit is contained in:
@@ -70,8 +70,14 @@ type CreateConfig struct {
|
||||
func (c *CreateConfig) Prepare() []error {
|
||||
var errs []error
|
||||
|
||||
if c.DiskSize == 0 {
|
||||
errs = append(errs, fmt.Errorf("'disk_size' is required"))
|
||||
if len(c.Storage) > 0 {
|
||||
for i, storage := range c.Storage {
|
||||
if storage.DiskSize == 0 {
|
||||
errs = append(errs, fmt.Errorf("storage[%d].'disk_size' is required", i))
|
||||
}
|
||||
}
|
||||
} else if c.DiskSize == 0 {
|
||||
errs = append(errs, fmt.Errorf("'disk_size' or 'storage' is required"))
|
||||
}
|
||||
|
||||
if c.GuestOSType == "" {
|
||||
|
||||
Reference in New Issue
Block a user