-
Notifications
You must be signed in to change notification settings - Fork 256
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework layer handling to return a ResourceCloser
Currently, the layers package relies on the caller of Mount*COWLayers to subsequently call NewImageLayers, which constructs a special ImageLayers object that can be used to later clean up the layer mounts. However, this requires the caller to know too much about the internals of the layer mounting process. A cleaner approach, which I take here, is to instead return a standard ResourceCloser from Mount*COWLayers which then knows how to clean up whatever mounts were done. I have also changed the layers code to use ResourceCloser in more places internally. There is a new check in resources_*cow.go, such that the layers closer is only stored if the container is not a hypervisor-isolated sandbox container. This duplicates the logic that was previously in (*ImageLayers).Release. Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
- Loading branch information
Showing
9 changed files
with
295 additions
and
357 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.