-
Notifications
You must be signed in to change notification settings - Fork 308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
propagation support for bind mounts (once docker-py supports it officially) #494
Open
jannefleischer
wants to merge
8
commits into
jupyterhub:main
Choose a base branch
from
jannefleischer:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
c746548
added support for propagation (if docker-py would support it ->
jannefleischer 9e43b7e
added homedir propagation modifications
jannefleischer 4e79e74
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 6a26456
fixing volume tests. hopefully.
jannefleischer f6dd767
Merge branch 'jupyterhub:main' into main
jannefleischer 43f2070
Merge branch 'main' of https://github.com/jannefleischer/dockerspawner
jannefleischer e2b8073
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] a2561b2
Merge pull request #1 from jupyterhub/main
jannefleischer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,13 +14,15 @@ def test_binds(monkeypatch): | |
d.user = types.SimpleNamespace(name="xyz") | ||
d.volumes = {"a": "b", "c": {"bind": "d", "mode": "Z"}} | ||
assert d.volume_binds == { | ||
"a": {"bind": "b", "mode": "rw"}, | ||
"c": {"bind": "d", "mode": "Z"}, | ||
"a": {"bind": "b", "mode": "rw", "propagation": 'rprivate'}, | ||
"c": {"bind": "d", "mode": "Z", "propagation": 'rprivate'}, | ||
} | ||
d.volumes = {"a": "b", "c": "d", "e": "f"} | ||
assert d.volume_mount_points == ["b", "d", "f"] | ||
d.volumes = {"/nfs/{username}": {"bind": "/home/{username}", "mode": "z"}} | ||
assert d.volume_binds == {"/nfs/xyz": {"bind": "/home/xyz", "mode": "z"}} | ||
assert d.volume_binds == { | ||
"/nfs/xyz": {"bind": "/home/xyz", "mode": "z", "propagation": 'rprivate'} | ||
} | ||
assert d.volume_mount_points == ["/home/xyz"] | ||
|
||
|
||
|
@@ -35,7 +37,13 @@ def test_format(label_template, spawner): | |
return "THIS IS A TEST" | ||
|
||
d.format_volume_name = test_format | ||
assert d.volume_binds == {"THIS IS A TEST": {"bind": "THIS IS A TEST", "mode": "z"}} | ||
assert d.volume_binds == { | ||
"THIS IS A TEST": { | ||
"bind": "THIS IS A TEST", | ||
"mode": "z", | ||
"propagation": 'rprivate', | ||
} | ||
} | ||
assert d.volume_mount_points == ["THIS IS A TEST"] | ||
|
||
|
||
|
@@ -46,7 +54,11 @@ def test_default_format_volume_name(monkeypatch): | |
d.user = types.SimpleNamespace(name="[email protected]") | ||
d.volumes = {"data/{username}": {"bind": "/home/{raw_username}", "mode": "z"}} | ||
assert d.volume_binds == { | ||
"data/user-40email-2ecom": {"bind": "/home/[email protected]", "mode": "z"} | ||
"data/user-40email-2ecom": { | ||
"bind": "/home/[email protected]", | ||
"mode": "z", | ||
"propagation": 'rprivate', | ||
} | ||
} | ||
assert d.volume_mount_points == ["/home/[email protected]"] | ||
|
||
|
@@ -60,7 +72,11 @@ def test_escaped_format_volume_name(monkeypatch): | |
d.volumes = {"data/{username}": {"bind": "/home/{username}", "mode": "z"}} | ||
d.format_volume_name = dockerspawner.volumenamingstrategy.escaped_format_volume_name | ||
assert d.volume_binds == { | ||
"data/user-40email-2ecom": {"bind": "/home/user-40email-2ecom", "mode": "z"} | ||
"data/user-40email-2ecom": { | ||
"bind": "/home/user-40email-2ecom", | ||
"mode": "z", | ||
"propagation": 'rprivate', | ||
} | ||
} | ||
assert d.volume_mount_points == ["/home/user-40email-2ecom"] | ||
|
||
|
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it required a manual patch, I would not consider this patch appropriate for this project, but since it's merged, can you reference the required version of docker-py here? It's not clear to me what that is.