Check condition for image_disk_format option

This commit is contained in:
Daisuke Takahashi 2018-09-20 10:24:39 +09:00
parent b7bd3d4b34
commit c848f59a55
1 changed files with 4 additions and 0 deletions

View File

@ -52,6 +52,10 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
return nil, errs
}
if b.config.ImageConfig.ImageDiskFormat != "" && !b.config.RunConfig.UseBlockStorageVolume {
return nil, fmt.Errorf("use_blockstorage_volume must be true if image_disk_format is specified.")
}
// By default, instance name is same as image name
if b.config.InstanceName == "" {
b.config.InstanceName = b.config.ImageName