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

Image architecture config #214

Merged

Conversation

BrennenMM7
Copy link
Contributor

This PR is to add image_architecture as a config for the packer plugin. Currently this plugin only supports provisioning Image Types of X86_64 in GCP disabling the ability to create ARM based images.

image_architecture will allow consumers of this plugin to modify the disk type being provisioned by GCE to enable ARM based packer images in GCP.

Test and validation are included with this PR to ensure that image_architecture is set to X86_64 or ARM64, by default it will select X86_64 as its the most common. This field is also optional so leaving it blank or an empty value will serve backwards compatibility for current configs.

@BrennenMM7 BrennenMM7 requested a review from a team as a code owner March 22, 2024 16:51
@hashicorp-cla
Copy link

hashicorp-cla commented Mar 22, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@lbajolet-hashicorp lbajolet-hashicorp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @BrennenMM7,

Thanks for the PR, this will definitely be useful when released.

I left a couple of nits/suggestions on the code, please feel free to address/discuss those, and we can iterate on that.

I think this is the kind of feature that would benefit from acceptance tests, I'll see what I can do once we've stabilised the base code.
Obviously if you are willing to implement some acceptance test for this feature this would be very appreciated, and don't hesitate to reach out if you need a hand with those, I'll be happy to help.

builder/googlecompute/config_test.go Outdated Show resolved Hide resolved
builder/googlecompute/config_test.go Outdated Show resolved Hide resolved
builder/googlecompute/config.go Outdated Show resolved Hide resolved
@lbajolet-hashicorp
Copy link
Contributor

Also, since you change the documentation for the Config structure, its docs partials need to be regenerated. You can use the generate target from the Makefile to do so if you have make installed on your machine.

@BrennenMM7 BrennenMM7 force-pushed the image_architecture-config branch from 13dcffa to d0e0d1f Compare March 25, 2024 19:45
Copy link
Contributor

@lbajolet-hashicorp lbajolet-hashicorp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @BrennenMM7,

Thanks for the reroll! I left a couple extra comments, especially regarding the case for the architecture, I'm not sure the APIs are case-sensitive for that enum, but it might be a good idea to make sure of that before merging (the acceptance tests may help to figure this one out though, I'll see if I can run them).

Other than that, this LGTM!

builder/googlecompute/config.go Outdated Show resolved Hide resolved
builder/googlecompute/config.go Show resolved Hide resolved
builder/googlecompute/config.go Outdated Show resolved Hide resolved
builder/googlecompute/config_test.go Show resolved Hide resolved
@BrennenMM7 BrennenMM7 force-pushed the image_architecture-config branch from 2d51571 to b57debf Compare April 2, 2024 14:27
@BrennenMM7 BrennenMM7 force-pushed the image_architecture-config branch from 8815be4 to aa283e8 Compare April 3, 2024 15:41
@BrennenMM7
Copy link
Contributor Author

@lbajolet-hashicorp Any chance of a green thumb? 🟢

Copy link
Contributor

@lbajolet-hashicorp lbajolet-hashicorp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @BrennenMM7,

Thanks for the reminder, and sorry I completely forgot to check back in after you re-uploaded the code, apologies for that!

I did a quick last review, the code looks good to me, I believe we can merge this today, thanks for being patient with us!

@lbajolet-hashicorp lbajolet-hashicorp merged commit 9f03e1d into hashicorp:main Apr 22, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants