fix typos

Signed-off-by: allencloud <allen.sun@daocloud.io>
This commit is contained in:
allencloud 2016-07-03 20:47:39 +08:00
parent 39536c4866
commit edc307cb92
3 changed files with 9 additions and 9 deletions

View file

@ -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

View file

@ -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

View file

@ -326,7 +326,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 {
@ -613,10 +613,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)
@ -625,7 +625,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")
@ -639,7 +639,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)