Return image fingerprint when building from base local/github images#73
Merged
beringresearch merged 1 commit intobravetools:masterfrom May 25, 2022
Merged
Conversation
… This ensures proper cleanup of images after build completion or in event of failure. Additionally, will cleanup local image as well as its unit if fail to start the unit.
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.
Importing base images from public LXD servers set the fingerprint string, but other paths in the code left the image fingerprint at its default value (""), causing it to be impossible to delete image by fingerprint later. This would happen when the image base location was set to local. To address the problem, all import functions also return the image fingerprint when done.
This change allows for proper cleanup of images after build completion or in event of failure.
Also added cleanup of local image if
importLocalfails to start a unit.Together these should helps address problems caused by LXD images hanging around after a build, preventing future builds that attempt to use that alias.