From 3eb83b5b2deb1911c671087853c6738df30fb531 Mon Sep 17 00:00:00 2001 From: allencloud Date: Sun, 3 Jul 2016 20:47:39 +0800 Subject: [PATCH] fix typos Signed-off-by: allencloud (cherry picked from commit edc307cb9213d11d9c5911b08ebd921a097939c0) Signed-off-by: Tibor Vass --- cli/required.go | 2 +- container/state.go | 6 +++--- daemon/daemon.go | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cli/required.go b/cli/required.go index 9276a5740a..8ee02c8429 100644 --- a/cli/required.go +++ b/cli/required.go @@ -7,7 +7,7 @@ import ( "github.com/spf13/cobra" ) -// NoArgs validate args and returns an error if there are any args +// NoArgs validates args and returns an error if there are any args func NoArgs(cmd *cobra.Command, args []string) error { if len(args) == 0 { return nil diff --git a/container/state.go b/container/state.go index 3922897165..081d91f41e 100644 --- a/container/state.go +++ b/container/state.go @@ -195,7 +195,7 @@ func (s *State) ExitCode() int { return res } -// SetExitCode set current exitcode for the state. Take lock before if state +// SetExitCode sets current exitcode for the state. Take lock before if state // may be shared. func (s *State) SetExitCode(ec int) { s.exitCode = ec @@ -214,7 +214,7 @@ func (s *State) SetRunning(pid int, initial bool) { } } -// SetStoppedLocking locks the container state is sets it to "stopped". +// SetStoppedLocking locks the container state and sets it to "stopped". func (s *State) SetStoppedLocking(exitStatus *ExitStatus) { s.Lock() s.SetStopped(exitStatus) @@ -290,7 +290,7 @@ func (s *State) SetRemovalInProgress() bool { return false } -// ResetRemovalInProgress make the RemovalInProgress state to false. +// ResetRemovalInProgress makes the RemovalInProgress state to false. func (s *State) ResetRemovalInProgress() { s.Lock() s.RemovalInProgress = false diff --git a/daemon/daemon.go b/daemon/daemon.go index 6ed203e5c3..e0503ec911 100644 --- a/daemon/daemon.go +++ b/daemon/daemon.go @@ -324,7 +324,7 @@ func (daemon *Daemon) waitForNetworks(c *container.Container) { } // Make sure if the container has a network that requires discovery that the discovery service is available before starting for netName := range c.NetworkSettings.Networks { - // If we get `ErrNoSuchNetwork` here, it can assumed that it is due to discovery not being ready + // If we get `ErrNoSuchNetwork` here, we can assume that it is due to discovery not being ready // Most likely this is because the K/V store used for discovery is in a container and needs to be started if _, err := daemon.netController.NetworkByName(netName); err != nil { if _, ok := err.(libnetwork.ErrNoSuchNetwork); !ok { @@ -611,10 +611,10 @@ func (daemon *Daemon) shutdownContainer(c *container.Container) error { // To terminate a process in freezer cgroup, we should send // SIGTERM to this process then unfreeze it, and the process will // force to terminate immediately. - logrus.Debugf("Found container %s is paused, sending SIGTERM before unpause it", c.ID) + logrus.Debugf("Found container %s is paused, sending SIGTERM before unpausing it", c.ID) sig, ok := signal.SignalMap["TERM"] if !ok { - return fmt.Errorf("System doesn not support SIGTERM") + return fmt.Errorf("System does not support SIGTERM") } if err := daemon.kill(c, int(sig)); err != nil { return fmt.Errorf("sending SIGTERM to container %s with error: %v", c.ID, err) @@ -623,7 +623,7 @@ func (daemon *Daemon) shutdownContainer(c *container.Container) error { return fmt.Errorf("Failed to unpause container %s with error: %v", c.ID, err) } if _, err := c.WaitStop(10 * time.Second); err != nil { - logrus.Debugf("container %s failed to exit in 10 second of SIGTERM, sending SIGKILL to force", c.ID) + logrus.Debugf("container %s failed to exit in 10 seconds of SIGTERM, sending SIGKILL to force", c.ID) sig, ok := signal.SignalMap["KILL"] if !ok { return fmt.Errorf("System does not support SIGKILL") @@ -637,7 +637,7 @@ func (daemon *Daemon) shutdownContainer(c *container.Container) error { } // If container failed to exit in 10 seconds of SIGTERM, then using the force if err := daemon.containerStop(c, 10); err != nil { - return fmt.Errorf("Stop container %s with error: %v", c.ID, err) + return fmt.Errorf("Failed to stop container %s with error: %v", c.ID, err) } c.WaitStop(-1 * time.Second)