summaryrefslogtreecommitdiff
path: root/daemon/rename.go
diff options
context:
space:
mode:
authorTibor Vass <tibor@docker.com>2015-09-29 13:51:40 -0400
committerTibor Vass <tibor@docker.com>2015-09-29 14:26:51 -0400
commitb08f071e18043abe8ce15f56826d38dd26bedb78 (patch)
tree8d81b2c563024040d0165381cf29725bb7336ab4 /daemon/rename.go
parent79c31f4b13d331d4011b2975a96dcdeab2036865 (diff)
downloaddocker-b08f071e18043abe8ce15f56826d38dd26bedb78.tar.gz
Revert "Merge pull request #16228 from duglin/ContextualizeEvents"
Although having a request ID available throughout the codebase is very valuable, the impact of requiring a Context as an argument to every function in the codepath of an API request, is too significant and was not properly understood at the time of the review. Furthermore, mixing API-layer code with non-API-layer code makes the latter usable only by API-layer code (one that has a notion of Context). This reverts commit de4164043546d2b9ee3bf323dbc41f4979c84480, reversing changes made to 7daeecd42d7bb112bfe01532c8c9a962bb0c7967. Signed-off-by: Tibor Vass <tibor@docker.com> Conflicts: api/server/container.go builder/internals.go daemon/container_unix.go daemon/create.go
Diffstat (limited to 'daemon/rename.go')
-rw-r--r--daemon/rename.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/daemon/rename.go b/daemon/rename.go
index 7595881605..de80e609f1 100644
--- a/daemon/rename.go
+++ b/daemon/rename.go
@@ -1,19 +1,18 @@
package daemon
import (
- "github.com/docker/docker/context"
derr "github.com/docker/docker/errors"
)
// ContainerRename changes the name of a container, using the oldName
// to find the container. An error is returned if newName is already
// reserved.
-func (daemon *Daemon) ContainerRename(ctx context.Context, oldName, newName string) error {
+func (daemon *Daemon) ContainerRename(oldName, newName string) error {
if oldName == "" || newName == "" {
return derr.ErrorCodeEmptyRename
}
- container, err := daemon.Get(ctx, oldName)
+ container, err := daemon.Get(oldName)
if err != nil {
return err
}
@@ -22,7 +21,7 @@ func (daemon *Daemon) ContainerRename(ctx context.Context, oldName, newName stri
container.Lock()
defer container.Unlock()
- if newName, err = daemon.reserveName(ctx, container.ID, newName); err != nil {
+ if newName, err = daemon.reserveName(container.ID, newName); err != nil {
return derr.ErrorCodeRenameTaken.WithArgs(err)
}
@@ -30,7 +29,7 @@ func (daemon *Daemon) ContainerRename(ctx context.Context, oldName, newName stri
undo := func() {
container.Name = oldName
- daemon.reserveName(ctx, container.ID, oldName)
+ daemon.reserveName(container.ID, oldName)
daemon.containerGraphDB.Delete(newName)
}
@@ -44,6 +43,6 @@ func (daemon *Daemon) ContainerRename(ctx context.Context, oldName, newName stri
return err
}
- container.logEvent(ctx, "rename")
+ container.logEvent("rename")
return nil
}