From c848f59a555238652ed6260bb3af5d0ec2b05a1e Mon Sep 17 00:00:00 2001 From: Daisuke Takahashi Date: Thu, 20 Sep 2018 10:24:39 +0900 Subject: [PATCH] Check condition for image_disk_format option --- builder/openstack/builder.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/builder/openstack/builder.go b/builder/openstack/builder.go index 7aba1d432..441636ae2 100644 --- a/builder/openstack/builder.go +++ b/builder/openstack/builder.go @@ -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