Skip to content

Commit

Permalink
Merge pull request moby#46846 from akerouanton/refactor/container-ren…
Browse files Browse the repository at this point in the history
…ame-move-log-args

daemon: ContainerRename: move log args to log fields
  • Loading branch information
akerouanton authored Nov 24, 2023
2 parents cfdca8d + b1676a2 commit 5ce8eee
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions daemon/rename.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,11 @@ func (daemon *Daemon) ContainerRename(oldName, newName string) (retErr error) {
if retErr != nil {
container.Name = oldName
container.NetworkSettings.IsAnonymousEndpoint = oldIsAnonymousEndpoint
if e := container.CheckpointTo(daemon.containersReplica); e != nil {
log.G(context.TODO()).Errorf("%s: Failed in writing to Disk on rename failure: %v", container.ID, e)
if err := container.CheckpointTo(daemon.containersReplica); err != nil {
log.G(context.TODO()).WithFields(log.Fields{
"containerID": container.ID,
"error": err,
}).Error("failed to write container state to disk during rename")
}
}
}()
Expand Down

0 comments on commit 5ce8eee

Please sign in to comment.