Return image fingerprint when building from base local/github images #73
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
importLocal
fails 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.