Validate container names on creation. Fixes #3138#3197
Merged
Conversation
Contributor
There was a problem hiding this comment.
Can you move this variable out of the method so that it's not created every time? At the top of this file is fine.
Member
|
Can we have hyphens too please? |
Contributor
|
+1 for hyphens. |
Contributor
Author
|
I added hyphens to the regex and moved the variable to the top of the file. |
Contributor
|
LGTM |
Member
There was a problem hiding this comment.
Why the parenthesis? We don't use the captured result anywhere, do we?
Contributor
Author
There was a problem hiding this comment.
Originally, I was trying to capture that group so the error message wouldn't contain the '/' that is sometimes at the start of a passed in name, but isn't actually a part of the name. I can safely remove the parenthesis.
Move valid container name regex to the top of the file Added hyphen as a valid rune in container names. Remove group in valid container name regex.
Contributor
Author
|
The group has now been removed from the regexp. |
Member
|
+1 me gusta :) |
Contributor
|
LGTM |
creack
added a commit
that referenced
this pull request
Dec 14, 2013
Validate container names on creation. Fixes #3138
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.
This adds a check in the runtime when creating a container to make sure the name only contains alpha-numeric characters and underscore. Fixes #3138.