mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-06 13:41:36 +00:00
golint fixes for daemon/ package
- some method names were changed to have a 'Locking' suffix, as the downcased versions already existed, and the existing functions simply had locks around the already downcased version. - deleting unused functions - package comment - magic numbers replaced by golang constants - comments all over Signed-off-by: Morgan Bauer <mbauer@us.ibm.com>
This commit is contained in:
+8
-6
@@ -5,6 +5,8 @@ import (
|
||||
"github.com/docker/docker/runconfig"
|
||||
)
|
||||
|
||||
// ContainerCommitConfig contains build configs for commit operation,
|
||||
// and is used when making a commit with the current state of the container.
|
||||
type ContainerCommitConfig struct {
|
||||
Pause bool
|
||||
Repo string
|
||||
@@ -15,14 +17,14 @@ type ContainerCommitConfig struct {
|
||||
}
|
||||
|
||||
// Commit creates a new filesystem image from the current state of a container.
|
||||
// The image can optionally be tagged into a repository
|
||||
// The image can optionally be tagged into a repository.
|
||||
func (daemon *Daemon) Commit(container *Container, c *ContainerCommitConfig) (*image.Image, error) {
|
||||
if c.Pause && !container.IsPaused() {
|
||||
container.Pause()
|
||||
defer container.Unpause()
|
||||
if c.Pause && !container.isPaused() {
|
||||
container.pause()
|
||||
defer container.unpause()
|
||||
}
|
||||
|
||||
rwTar, err := container.ExportRw()
|
||||
rwTar, err := container.exportRw()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -55,6 +57,6 @@ func (daemon *Daemon) Commit(container *Container, c *ContainerCommitConfig) (*i
|
||||
return img, err
|
||||
}
|
||||
}
|
||||
container.LogEvent("commit")
|
||||
container.logEvent("commit")
|
||||
return img, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user