From 0cddfcad2f4e01fd0c4ea8b7e1c7c75908b45ee6 Mon Sep 17 00:00:00 2001 From: allencloud Date: Fri, 23 Dec 2016 20:48:25 +0800 Subject: [PATCH] fix nits in comments Signed-off-by: allencloud Upstream-commit: 6fb05778ba241b344dd9014ff1091e3f70a8b40c Component: engine --- components/engine/api/types/time/timestamp.go | 2 +- components/engine/builder/dockerfile/internals.go | 6 +++--- components/engine/cli/command/swarm/unlock.go | 2 +- components/engine/daemon/config.go | 2 +- components/engine/daemon/daemon.go | 2 +- components/engine/daemon/daemon_solaris.go | 2 +- components/engine/daemon/daemon_unix.go | 2 +- components/engine/daemon/daemon_windows.go | 2 +- components/engine/daemon/kill.go | 2 +- components/engine/daemon/stop.go | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/components/engine/api/types/time/timestamp.go b/components/engine/api/types/time/timestamp.go index d3695ba723..7d2798af76 100644 --- a/components/engine/api/types/time/timestamp.go +++ b/components/engine/api/types/time/timestamp.go @@ -84,7 +84,7 @@ func GetTimestamp(value string, reference time.Time) (string, error) { } if err != nil { - // if there is a `-` then its an RFC3339 like timestamp otherwise assume unixtimestamp + // if there is a `-` then it's an RFC3339 like timestamp otherwise assume unixtimestamp if strings.Contains(value, "-") { return "", err // was probably an RFC3339 like timestamp but the parser failed with an error } diff --git a/components/engine/builder/dockerfile/internals.go b/components/engine/builder/dockerfile/internals.go index 6f0a367842..63aae01471 100644 --- a/components/engine/builder/dockerfile/internals.go +++ b/components/engine/builder/dockerfile/internals.go @@ -188,7 +188,7 @@ func (b *Builder) runContextCommand(args []string, allowRemote bool, allowLocalD comment := fmt.Sprintf("%s %s in %s", cmdName, origPaths, dest) - // Twiddle the destination when its a relative path - meaning, make it + // Twiddle the destination when it's a relative path - meaning, make it // relative to the WORKINGDIR if dest, err = normaliseDest(cmdName, b.runConfig.WorkingDir, dest); err != nil { return err @@ -384,11 +384,11 @@ func (b *Builder) processImageFrom(img builder.Image) error { } // Check to see if we have a default PATH, note that windows won't - // have one as its set by HCS + // have one as it's set by HCS if system.DefaultPathEnv != "" { // Convert the slice of strings that represent the current list // of env vars into a map so we can see if PATH is already set. - // If its not set then go ahead and give it our default value + // If it's not set then go ahead and give it our default value configEnv := opts.ConvertKVStringsToMap(b.runConfig.Env) if _, ok := configEnv["PATH"]; !ok { b.runConfig.Env = append(b.runConfig.Env, diff --git a/components/engine/cli/command/swarm/unlock.go b/components/engine/cli/command/swarm/unlock.go index f7d418760b..aa752e2148 100644 --- a/components/engine/cli/command/swarm/unlock.go +++ b/components/engine/cli/command/swarm/unlock.go @@ -37,7 +37,7 @@ func runUnlock(dockerCli *command.DockerCli, opts unlockOptions) error { client := dockerCli.Client() ctx := context.Background() - // First see if the node is actually part of a swarm, and if it's is actually locked first. + // First see if the node is actually part of a swarm, and if it is actually locked first. // If it's in any other state than locked, don't ask for the key. info, err := client.Info(ctx) if err != nil { diff --git a/components/engine/daemon/config.go b/components/engine/daemon/config.go index 42ef18f74a..3821ec27dc 100644 --- a/components/engine/daemon/config.go +++ b/components/engine/daemon/config.go @@ -239,7 +239,7 @@ func parseClusterAdvertiseSettings(clusterStore, clusterAdvertise string) (strin return advertise, nil } -// GetConflictFreeLabels validate Labels for conflict +// GetConflictFreeLabels validates Labels for conflict // In swarm the duplicates for labels are removed // so we only take same values here, no conflict values // If the key-value is the same we will only take the last label diff --git a/components/engine/daemon/daemon.go b/components/engine/daemon/daemon.go index e41943375a..275990360c 100644 --- a/components/engine/daemon/daemon.go +++ b/components/engine/daemon/daemon.go @@ -640,7 +640,7 @@ func NewDaemon(config *Config, registryService registry.Service, containerdRemot logrus.Infof("Graph migration to content-addressability took %.2f seconds", time.Since(migrationStart).Seconds()) // Discovery is only enabled when the daemon is launched with an address to advertise. When - // initialized, the daemon is registered and we can store the discovery backend as its read-only + // initialized, the daemon is registered and we can store the discovery backend as it's read-only if err := d.initDiscovery(config); err != nil { return nil, err } diff --git a/components/engine/daemon/daemon_solaris.go b/components/engine/daemon/daemon_solaris.go index 2b4d8d0216..17a593f56b 100644 --- a/components/engine/daemon/daemon_solaris.go +++ b/components/engine/daemon/daemon_solaris.go @@ -301,7 +301,7 @@ func verifyPlatformContainerSettings(daemon *Daemon, hostConfig *containertypes. return warnings, nil } -// platformReload update configuration with platform specific options +// platformReload updates configuration with platform specific options func (daemon *Daemon) platformReload(config *Config) map[string]string { return map[string]string{} } diff --git a/components/engine/daemon/daemon_unix.go b/components/engine/daemon/daemon_unix.go index 3e0cd2e7db..e8df9199cc 100644 --- a/components/engine/daemon/daemon_unix.go +++ b/components/engine/daemon/daemon_unix.go @@ -556,7 +556,7 @@ func verifyPlatformContainerSettings(daemon *Daemon, hostConfig *containertypes. return warnings, nil } -// platformReload update configuration with platform specific options +// platformReload updates configuration with platform specific options func (daemon *Daemon) platformReload(config *Config) map[string]string { if config.IsValueSet("runtimes") { daemon.configStore.Runtimes = config.Runtimes diff --git a/components/engine/daemon/daemon_windows.go b/components/engine/daemon/daemon_windows.go index 91c7be1571..59235c911b 100644 --- a/components/engine/daemon/daemon_windows.go +++ b/components/engine/daemon/daemon_windows.go @@ -203,7 +203,7 @@ func verifyPlatformContainerSettings(daemon *Daemon, hostConfig *containertypes. return warnings, err } -// platformReload update configuration with platform specific options +// platformReload updates configuration with platform specific options func (daemon *Daemon) platformReload(config *Config) map[string]string { return map[string]string{} } diff --git a/components/engine/daemon/kill.go b/components/engine/daemon/kill.go index a91f756c3d..ba0dbe1f55 100644 --- a/components/engine/daemon/kill.go +++ b/components/engine/daemon/kill.go @@ -119,7 +119,7 @@ func (daemon *Daemon) Kill(container *container.Container) error { if err := daemon.killPossiblyDeadProcess(container, int(syscall.SIGKILL)); err != nil { // While normally we might "return err" here we're not going to // because if we can't stop the container by this point then - // its probably because its already stopped. Meaning, between + // it's probably because it's already stopped. Meaning, between // the time of the IsRunning() call above and now it stopped. // Also, since the err return will be environment specific we can't // look for any particular (common) error that would indicate diff --git a/components/engine/daemon/stop.go b/components/engine/daemon/stop.go index aa7b3820c8..a17e8c8dde 100644 --- a/components/engine/daemon/stop.go +++ b/components/engine/daemon/stop.go @@ -52,7 +52,7 @@ func (daemon *Daemon) containerStop(container *container.Container, seconds int) if err := daemon.killPossiblyDeadProcess(container, stopSignal); err != nil { // While normally we might "return err" here we're not going to // because if we can't stop the container by this point then - // its probably because its already stopped. Meaning, between + // it's probably because it's already stopped. Meaning, between // the time of the IsRunning() call above and now it stopped. // Also, since the err return will be environment specific we can't // look for any particular (common) error that would indicate