daemon: ContainerRename: move log args to log fields

Also, err `e` is renamed into the more standard `err` as the defer
already uses `retErr` to avoid clashes (changed in f5a611a74).

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
This commit is contained in:
Albin Kerouanton 2023-11-07 14:00:49 +01:00
parent 35eba19a65
commit b1676a289c
No known key found for this signature in database
GPG key ID: 630B8E1DCBDB1864

View file

@ -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")
}
}
}()