daemon: Daemon.CreateImageFromContainer(): remove intermediate vars

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2023-04-29 02:59:54 +02:00
parent bf5ae17c16
commit 167fa429f0
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -132,13 +132,11 @@ func (daemon *Daemon) CreateImageFromContainer(ctx context.Context, name string,
}
if container.IsDead() {
err := fmt.Errorf("You cannot commit container %s which is Dead", container.ID)
return "", errdefs.Conflict(err)
return "", errdefs.Conflict(fmt.Errorf("You cannot commit container %s which is Dead", container.ID))
}
if container.IsRemovalInProgress() {
err := fmt.Errorf("You cannot commit container %s which is being removed", container.ID)
return "", errdefs.Conflict(err)
return "", errdefs.Conflict(fmt.Errorf("You cannot commit container %s which is being removed", container.ID))
}
if c.Pause && !container.IsPaused() {