Accurate architectures and image matching #198
Merged
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.
Image architectures
This PR changes the way bravetools stores image architectures to align with the architectures reported by the build LXD server. This also addresses issues caused when using a remote build server that is a different architecture than the bravetools host.
Prior to this change, image architectures would be dervied from the runtime.GOARCH. For example: amd64/arm64.
After this change the LXD server reported value will be used. For example: x86_64/armv6l.
Image version "untagged" by default
Previously bravetools used version "1.0" as a default, but this was arbitrary and could be confusing if the user actually specified 1.0 themselves. The "untagged" version makes it clearer that it is not user-provided and avoids potential conflicts.
Image matching
This PR also adds image matching where partially defined images will be matched in certain cases. This allows the user to specify images via shorthand by excluding the version/architecture field. So long as only one possible image matches the image description the image will be matched. In cases where there are multiple possible matching images an error will be raised.
For example: