Repository navigation
Validate volume names for the local driver. - #17213
Conversation
Signed-off-by: xlgao-zju <[email protected]>
|
LGTM |
There was a problem hiding this comment.
There was a problem hiding this comment.
I changed the regexp to match the container names, this should work now.
aeaacbe to
d74fead
Compare
|
not fond of having it in |
There was a problem hiding this comment.
the regular expression doesn't allow anything that doesn't start with a-zA-Z0-9, so testing that it's not a . covers those cases too.
There was a problem hiding this comment.
But the test is to verify that we do indeed reject certain patterns, this should be independent of the implementation.
There was a problem hiding this comment.
I just added those tests. Can you take another look?
|
@calavera Why the |
|
I'm not fond of that package either, that's not the only file there, fwiw, we already have a bunch of things in that utils package. I'm open to suggestions but I didn't want to introduce a new package only for this. |
|
@calavera ohh for real.. never saw the package lol.. need to open my eyes more 😸. |
There was a problem hiding this comment.
status 400 Bad request is probably more appropriate here. 5XX errors are really for "server made a 'whoopsie'"
There was a problem hiding this comment.
either is fine because at some point (after the errcode disucssions) we'll be looking at each error and making sure it has the right status code. But getting it to be 400 now is good :-)
|
Thanks @calavera! LGTM. Only concern: how do we handle migration of existing volumes that are no longer valid? Also: lets keep the discussion open for loosening up and being less restrictive after 1.9 |
|
oh, after looking at the error code that is (no real show-stopper, but |
415084d to
dc3bcb0
Compare
Delegate validation tasks to the volume drivers. It's up to them to decide whether a name is valid or not. Restrict volume names for the local driver to prevent creating mount points outside docker's volumes directory. Signed-off-by: David Calavera <[email protected]>
dc3bcb0 to
d6d6028
Compare
|
thanks for addressing the issues @calavera |
|
Will run these tests locally |
|
Added impact/changelog; do we need a mention in "deprecations" to tell people that some volume names are no longer valid? |
|
Tests are good locally. @thaJeztah for the merge if docs are needed. |
|
@calavera I think we should add a mention to https://github.com/docker/docker/blob/master/docs/misc/deprecated.md so that people are aware that this changed, wdyt? |
|
@thaJeztah this is not a feature change or improvement, this is a bug fix. From my point of view, it should go into the bug fixes section in the backlog. |
|
@calavera cool 👍 |
Validate volume names for the local driver.
|
Removing impact/changelog since |
Closes #16132
Closes #16140