builder/amazon/chroot: Fix building PV images with mount_partition

Right now, if we have a source image that's PV, and try to build an
image with mount_partition set to not 0, it does not get picked up.
This is because under PV we only had a filesystem, not partitions,
but you can convert a PV image to an HVM image during build time.
This commit is contained in:
Sargun Dhillon 2019-02-22 17:26:58 -08:00
parent 4da79a8837
commit d3c65ee77d
1 changed files with 1 additions and 1 deletions

View File

@ -42,7 +42,7 @@ func (s *StepMountDevice) Run(_ context.Context, state multistep.StateBag) multi
wrappedCommand := state.Get("wrappedCommand").(CommandWrapper)
var virtualizationType string
if config.FromScratch {
if config.FromScratch || config.AMIVirtType != "" {
virtualizationType = config.AMIVirtType
} else {
image := state.Get("source_image").(*ec2.Image)