-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Breaking change with image_architecture
in 1.1.5
#232
Comments
I am also seeing this issue trying to build ARM64 images with the 1.1.5 release. |
Hi @rifelpet, Thanks for the call-out; I remember pointing this out in my review at the time, and opted to merge it as-is since it felt safe at first glance, but I was wrong, sorry about this. Looking at the API docs, it's not super clear what information we can get about the instances (the APIs don't seem to expose architecture on things other than disks it seems?) or the image, but maybe we can just default on not specifying it. There is a Regarding deriving the architecture from the instance type, I don't think the API/SDK exposes that unfortunately, the image should however, maybe we can use this if the arch is undefined in the configs. I'll update the thread when I've got something, if possible would you be able to test it once it's up before we release? I'd like to make sure the change works before rolling it in. Thanks! |
Yes I'm happy to test a potential fix. |
Hi @rifelpet, I've opened PR #234 that addresses this, now the default value for image_architecture is the empty string, which is what is sent to the APIs again. I've added some acceptance tests that should make sure we don't end-up with this again in the future, but if possible I'd suggest testing to build and use the plugin to run some tests with your existing configs. Not sure if you have seen the changes to how plugins are handled with Packer 1.11.x, but for reference I'll leave a link to our docs, I'd suggest using Thanks in advance! |
I confirmed that #234 fixes the problem 👍🏻 |
Thanks for the update and the test @rifelpet! I've merged the change in, and will release the plugin today, hopefully that'll fix things for everyone. Thanks again for reporting this, and sorry for the blunder in the first place! |
Overview of the Issue
The recent 1.1.5 release included a breaking change in #214.
When unset the value defaults to
X86_64
. In prior versions, the value implicitly defaulted to the machine_type's architecture. This means when building with anARM64
machine_type and source_image, upgrading to 1.1.5 introduces this error:Error waiting for image: googleapi: Error 400: Invalid value for field 'resource.architecture': 'X86_64'. Requested architecture must be the same as the source resource architecture (ARM64)., invalid
The error is fixed by setting
image_architecture = "ARM64"
. This required change is not mentioned in the release notes.I think a better default for the
image_architecture
field is to use the machine_type's architecture, since it would be one less field that users need to add when building ARM64 images.Reproduction Steps
Build an image from an ARM64 machine type and source image but without image_architecture set.
Plugin and Packer version
Packer v1.11.2
Simplified Packer Buildfile
The below configuration fails to build. Adjusting the
required_plugins
to1.1.4
succeeds.Operating system and Environment details
OS, Architecture, and any other information you can provide about the
environment.
Log Fragments and crash.log files
Here are logs from a successful build with 1.1.4:
Here are logs from a failing build with 1.1.5:
The text was updated successfully, but these errors were encountered: