mirror of https://github.com/docker/docs.git
Merge pull request #2904 from SvenDowideit/dont-show-user-internal-slash-in-error-message
there appears to be a slash prepended to a container name internally
This commit is contained in:
commit
f75dc36204
|
@ -422,7 +422,8 @@ func (runtime *Runtime) Create(config *Config, name string) (*Container, []strin
|
||||||
if _, err := runtime.containerGraph.Set(name, id); err != nil {
|
if _, err := runtime.containerGraph.Set(name, id); err != nil {
|
||||||
if strings.HasSuffix(err.Error(), "name are not unique") {
|
if strings.HasSuffix(err.Error(), "name are not unique") {
|
||||||
conflictingContainer, _ := runtime.GetByName(name)
|
conflictingContainer, _ := runtime.GetByName(name)
|
||||||
return nil, nil, fmt.Errorf("Conflict, The name %s is already assigned to %s. You have to delete (or rename) that container to be able to assign %s to a container again.", name, utils.TruncateID(conflictingContainer.ID), name)
|
nameAsKnownByUser := strings.TrimPrefix(name, "/")
|
||||||
|
return nil, nil, fmt.Errorf("Conflict, The name %s is already assigned to %s. You have to delete (or rename) that container to be able to assign %s to a container again.", nameAsKnownByUser, utils.TruncateID(conflictingContainer.ID), nameAsKnownByUser)
|
||||||
}
|
}
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue