Merge pull request #8975 from jhawk28/vsphereiso_disksize_fix
disk_size should not be required if storage is defined
This commit is contained in:
commit
fc911f0731
|
@ -70,8 +70,14 @@ type CreateConfig struct {
|
||||||
func (c *CreateConfig) Prepare() []error {
|
func (c *CreateConfig) Prepare() []error {
|
||||||
var errs []error
|
var errs []error
|
||||||
|
|
||||||
if c.DiskSize == 0 {
|
if len(c.Storage) > 0 {
|
||||||
errs = append(errs, fmt.Errorf("'disk_size' is required"))
|
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 == "" {
|
if c.GuestOSType == "" {
|
||||||
|
|
Loading…
Reference in New Issue