Architecture support (vagrant-cloud post-processor)#101
Merged
nywilken merged 1 commit intohashicorp:mainfrom Oct 6, 2023
Merged
Architecture support (vagrant-cloud post-processor)#101nywilken merged 1 commit intohashicorp:mainfrom
nywilken merged 1 commit intohashicorp:mainfrom
Conversation
8c4b566 to
59ca16f
Compare
a415e94 to
90af3b7
Compare
nywilken
reviewed
Oct 3, 2023
Contributor
nywilken
left a comment
There was a problem hiding this comment.
@chrisroberts I like the new approach. It clarifies how architecture and default_architecture are used and does a nice job of extracting the information from the metadata.json file. I have a few suggestions on the metadata extraction logic to help reduce some of the nil checks and not hide what is going on in each of the load metadata from Vagrant box functions.
Let me know what you think. I did not test the suggested changes as I did not update the test but I think it should be equal to what you had but it moves all the metadata.json file reading/testing to the metadataFromVagrantBox function.
90af3b7 to
5102e3f
Compare
Adds architecture support to the vagrant post-processor. Can be provided via configuration. If unset, it will automatically be defaulted to the builder host's detected architecture. File builder support was added to the vagrant post-processor to make testing easier. Architecture support added to the vagrant-cloud post-processor. Includes updating to the `v2` API which includes architecture support. Two new options are added: * `architecture` - architecture of the guest * `default_architecture` - backwards compatibility feature The new options are used when creating a provider, and the architecture value is used on the API path when preparing the upload. Small adjustment in the vagrant-cloud post-processor test so the artifact's `IdValue` matches the defined box's provider. This was simply done to provide a bit more clarity on the mocked API paths.
5102e3f to
757123a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds architecture support to the vagrant and the vagrant-cloud post-processors.
Vagrant post-processor
Introduces a new configuration option to the vagrant post-processor:
architecture- stringThis is an optional value that will automatically default to the host platform's architecture. The architecture value will be included within the
metadata.jsonfile of the generated box.Also included with this changeset is support for the
filebuilder. This was just done to make it easier for testing generated boxes.Vagrant Cloud post-processor
Updates the API calls to use Vagrant Cloud's v2 API. The
v2API supports architecture metadata for providers and the post-processor has been updated to include architecture information. New configurations options added:architecture- stringdefault_architecture- stringBy default, the post-processor will read the architecture information from the
metadata.jsonwithin the box. If the box metadata does not include architecture information, or the architecture needs to be overridden for some reason, it can be defined using thearchitectureconfiguration option.The
default_architectureoption is used for backwards compatibility support (more information available in the Vagrant Cloud docs). If the architecture value set indefault_architecturematches the architecture of the box then it will be marked as the default architecture on Vagrant Cloud.Also adjusted the vagrant-cloud post-processor test so the artifact's
IdValuematches the defined box's provider to provide a bit more clarity on the mocked API paths.