Repository navigation
Add WithRootFSShareDir to share a caller-prepared rootfs dir - #176
Open
thejoeejoee wants to merge 1 commit into
Open
thejoeejoee wants to merge 1 commit into
thejoeejoee wants to merge 1 commit into
Conversation
5 of 6 tasks
Contributor
Author
|
@jhrozek any chance you could take a look at this? |
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.
Closes #177.
Adds
WithRootFSShareDir(tag, dir), a sibling ofWithRootFSShare(#160) for callers that prepare the shared root themselves instead of taking it from the image cache.Runboots from the same empty root directory in the data dir (hooks, guest VM config and.krun_config.jsonland there) and sharesdirread-only over virtio-fs undertag. No image is pulled andimageRefis ignored, so hooks get a nil OCI config and the environment comes fromWithEnv.Use case: jailoc converts OCI layers into per-layer EROFS images on the host and the guest init mounts them as overlay lowers (seznam/jailoc#361). There is no unpacked rootfs in the image cache to point
WithRootFSShareat, andWithRootFSPathwould put.krun_config.jsonand the hooks' files into the shared directory.dirmust be an absolute path to an existing directory; rejected together withWithRootFSPath. Tag collisions are checked as forWithRootFSShare.WithRootFSShareandWithRootFSShareDirreplace each other, last one wins.VM.Removekeepsdir.Testing
TestRun_RootFSShareDir_SharesDirReadOnly: no image pull, hooks see an empty root and a nil OCI config, nothing is written intodir, the backend gets the read-only mount ofdir,Removekeeps it.TestRun_RootFSShareDir_Validation: relative, missing and non-directory paths and the combination withWithRootFSPathfail before the backend starts.TestWithRootFSShareDir_ReplacesRootFSShare.go test .