allow dynamic LocalDir access#3228
Merged
Merged
Conversation
Changes the filesync attachable to accept an interface instead of a static allowlist of dirs. This way a single session can support syncing directories not known ahead of time. Signed-off-by: Alex Suraci <suraci.alex@gmail.com>
affda29 to
3548517
Compare
Contributor
Author
|
@tonistiigi Done! |
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.
Changes the filesync attachable to accept an interface instead of a static allowlist of dirs. This way a single session can support syncing directories not known ahead of time.
Use case: for Dagger we currently run the entire API server with a single Buildkit session, but we would like our API to support reading arbitrary host directories. Currently the user has to configure directories statically ahead of time, which results in an awkward API + configuration coupling we'd like to avoid. The relevant PR is dagger/dagger#3560 - currently it uses an extracted
filesyncpackage, so we're not blocked on this PR.With this change we can manually add a filesync
session.Attachablethat allows arbitrary access using the path as the directory name, e.g.llb.Local("/foo/bar").Note: we totally understand the risk of allowing unfettered host filesystem access, and will have to defend against it ourselves. Fortunately this is pretty easy to do by just implementing our own
DirSourcewith our own access control logic.