there appears to be a slash prepended to a container name internally - don't tell the user about it in an error message, it might cause them to worry about it
This commit is contained in:
parent
6344e6f258
commit
1cb7b9adc6
1 changed files with 2 additions and 1 deletions
|
@ -422,7 +422,8 @@ func (runtime *Runtime) Create(config *Config, name string) (*Container, []strin
|
|||
if _, err := runtime.containerGraph.Set(name, id); err != nil {
|
||||
if strings.HasSuffix(err.Error(), "name are not unique") {
|
||||
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
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue