Optional legacy image filename#213
Merged
idroz merged 5 commits intobravetools:masterfrom Nov 25, 2022
Merged
Conversation
…strings used (and source filename on err). This is necessary since otherwise the user does not know the name/version/arch of the newly imported image unless they are familiar with the parsing rules or do a diff before/after
…ImageFromFilename` function. It being non-optional was a problem as it could lead to issues with incorrectly parsing a name with a hyphen in as a version. Update `ListLocalImages` to handle modern/legacy filenames by checking which one exists. Other users of the `ImageFromFilename` function will default to only accepting modern filename structure (for example `ImportLocalImage`).
…return errors, where the basename simply consists of the separator character
…the error encounetered with validation function
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.
Legacy image filename parsing was not optional when calling
ImageFromFilename. This could lead to problems with incorrectly parsing names with hyphens as versions. Legacy parsing should be opt in and used only in places it makes sense.Command line commands will now default to modern image syntax. Legacy parsing reserved only for listing images in the bravetools image store.
Also included in this PR are better validation of names and improved error messaging.