1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Prefix / to the container name is ignored when container is renamed

Closes #10996

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
This commit is contained in:
Srini Brahmaroutu 2015-02-25 04:19:49 +00:00
parent 2768ce0e4e
commit caaae78247
3 changed files with 5 additions and 5 deletions

View file

@ -119,7 +119,7 @@ RUN set -x \
go build -o /go/bin/registry-v2 github.com/docker/distribution/cmd/registry
# Get the "docker-py" source so we can run their integration tests
ENV DOCKER_PY_COMMIT d39da1167975aaeb6c423b99621ecda1223477b8
ENV DOCKER_PY_COMMIT 91985b239764fe54714fa0a93d52aa362357d251
RUN git clone https://github.com/docker/docker-py.git /docker-py \
&& cd /docker-py \
&& git checkout -q $DOCKER_PY_COMMIT

View file

@ -20,7 +20,7 @@ func (daemon *Daemon) ContainerRename(job *engine.Job) engine.Status {
container.Lock()
defer container.Unlock()
if _, err := daemon.reserveName(container.ID, newName); err != nil {
if newName, err = daemon.reserveName(container.ID, newName); err != nil {
return job.Errorf("Error when allocating new name: %s", err)
}

View file

@ -35,7 +35,7 @@ func TestRenameStoppedContainer(t *testing.T) {
if err != nil {
t.Fatal(err)
}
if name != "new_name" {
if name != "/new_name" {
t.Fatal("Failed to rename container ", name)
}
@ -62,7 +62,7 @@ func TestRenameRunningContainer(t *testing.T) {
if err != nil {
t.Fatal(err)
}
if name != "new_name" {
if name != "/new_name" {
t.Fatal("Failed to rename container ")
}
@ -88,7 +88,7 @@ func TestRenameCheckNames(t *testing.T) {
if err != nil {
t.Fatal(err)
}
if name != "new_name" {
if name != "/new_name" {
t.Fatal("Failed to rename container ")
}