Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

capi packer qemu build no longer builds qemu images; unconditionally builds vagrant boxes #454

Closed
carstenkoester opened this issue Dec 11, 2020 · 0 comments · Fixed by #460

Comments

@carstenkoester
Copy link
Contributor

carstenkoester commented Dec 11, 2020

Steps:

git clone https://github.com/kubernetes-sigs/image-builder
git checkout fda34643 # HEAD at the time this issue was reported
cd image-builder/images/capi
make build-qemu-ubuntu-2004

The build artifact used to be (and is expected to be) a qcow2 image in the output/ directory, but now always builds a Vagrant box:

...
==> ubuntu-2004: Gracefully halting virtual machine...
==> ubuntu-2004: Converting hard drive...
==> ubuntu-2004: Running post-processor: vagrant
==> ubuntu-2004 (vagrant): Creating a dummy Vagrant box to ensure the host system can create one correctly
==> ubuntu-2004 (vagrant): Creating Vagrant box for 'libvirt' provider
    ubuntu-2004 (vagrant): Copying from artifact: output/ubuntu-2004-kube-v1.17.11/ubuntu-2004-kube-v1.17.11
    ubuntu-2004 (vagrant): Compressing: Vagrantfile
    ubuntu-2004 (vagrant): Compressing: box.img
    ubuntu-2004 (vagrant): Compressing: metadata.json
Build 'ubuntu-2004' finished after 11 minutes 49 seconds.

# ls output/
# ls *box
packer_ubuntu-2004_libvirt.box

Checking out an earlier revision, df55d6f, restores the behavior of make build-qemu-ubuntu-2004 actually building qemu/qcow2 artifacts.

It seems like the post-processor was recently added to packer.json,

$ git blame -f -s packer.json
...
d8e1b6b23 images/capi/packer/qemu/packer.json  96)     }
892282320 images/capi/packer/qemu/packer.json  97)   ],
892282320 images/capi/packer/qemu/packer.json  98)   "post-processors": [
892282320 images/capi/packer/qemu/packer.json  99)     {
6ab0a4feb images/capi/packer/qemu/packer.json 100)       "type": "vagrant"
892282320 images/capi/packer/qemu/packer.json 101)     }
d8e1b6b23 images/capi/packer/qemu/packer.json 102)   ]
d8e1b6b23 images/capi/packer/qemu/packer.json 103) }

with 8922823 and 6ab0a4f both being merged yesterday (as part of #248).

Manual workaround is to either remove the vagrant post-processor, or add keep_input_artifact = true to it so that it preserves the original qcow2 image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant