Warn if not a pv build but builder image entry is set. cleanup

This commit is contained in:
Matthew Hooker 2018-10-29 15:23:58 -07:00
parent f0d875ce3f
commit 42cd3e4bf7
No known key found for this signature in database
GPG Key ID: 7B5F933D9CE8C6A1
1 changed files with 8 additions and 3 deletions

View File

@ -90,7 +90,12 @@ func (c *PVConfig) Prepare(ctx *interpolate.Context) (errs *packer.MultiError) {
}
if c.BuilderImageList != "" {
errs = packer.MultiErrorAppend(errs,
fmt.Errorf("`builder_shape_image_list` has no meaning when `persistent_volume_size` is not set."))
fmt.Errorf("`builder_image_list` has no meaning when `persistent_volume_size` is not set."))
}
if c.BuilderImageListEntry != nil {
errs = packer.MultiErrorAppend(errs,
fmt.Errorf("`builder_image_list_entry` has no meaning when `persistent_volume_size` is not set."))
}
return errs
}
@ -113,8 +118,8 @@ func (c *PVConfig) Prepare(ctx *interpolate.Context) (errs *packer.MultiError) {
c.BuilderImageList = imageListDefault
}
// Entry 5 is a working default, so let's set it if the entry is unset and
// we're using the default image list
// Set to known working default if this is unset and we're using the
// default image list
if c.BuilderImageListEntry == nil {
var entry int
if c.BuilderImageList == imageListDefault {