-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Add randomly generated slug to container names to prevent collisions #6140
Conversation
69be0a3
to
554eca2
Compare
554eca2
to
06fb161
Compare
3a19eeb
to
1165301
Compare
Signed-off-by: Joffrey F <joffrey@docker.com>
ae3f9bf
to
70654cf
Compare
Relating to #1516 , this fixes concerns 2 and 3. The costly queries are unfortunately still there, but this PR is a compromise intended to cause minimal disruption to existing workflows. While this can be seen as a breaking change in the sense that container names can no longer be inferred the way they could before, it should be noted that
|
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.
LGTM except for a few minor questions.
@@ -151,3 +152,21 @@ def unquote_path(s): | |||
if s[0] == '"' and s[-1] == '"': | |||
return s[1:-1] | |||
return s | |||
|
|||
|
|||
def generate_random_id(): |
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.
Why do we use such a complicated algorithm to generate a random identifier? And is there any specific reason we don't want a fully numerical ID?
Otherwise uuid.uuid4().hex
sounds good to generate a hexadecimal identifier, no?
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.
The code is a transposition of https://github.com/moby/moby/blob/master/pkg/stringid/stringid.go ; we could go with a UUID instead.
tests/acceptance/cli_test.py
Outdated
assert 'Removing v2-full_web_' in result.stderr | ||
assert 'Removing v2-full_other_' in result.stderr | ||
assert 'Removing v2-full_web_run_' in result.stderr | ||
assert 'Removing v2-full_web_run_' in result.stderr |
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.
Duplicated.
Signed-off-by: Joffrey F <joffrey@docker.com>
70654cf
to
5916639
Compare
Fixes #4688