Skip to content

Commit

Permalink
Merge pull request moby#21767 from allencloud/fix-typos
Browse files Browse the repository at this point in the history
fix typos
  • Loading branch information
aaronlehmann committed Apr 6, 2016
2 parents fc9912f + 34700cc commit 81b01b4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion runconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func (r ContainerDecoder) DecodeHostConfig(src io.Reader) (*container.HostConfig
}

// DecodeContainerConfig decodes a json encoded config into a ContainerConfigWrapper
// struct and returns both a Config and an HostConfig struct
// struct and returns both a Config and a HostConfig struct
// Be aware this function is not checking whether the resulted structs are nil,
// it's your business to do so
func DecodeContainerConfig(src io.Reader) (*container.Config, *container.HostConfig, *networktypes.NetworkingConfig, error) {
Expand Down
2 changes: 1 addition & 1 deletion runconfig/opts/opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func doesEnvExist(name string) bool {
}

// ValidateExtraHost validates that the specified string is a valid extrahost and returns it.
// ExtraHost are in the form of name:ip where the ip has to be a valid ip (ipv4 or ipv6).
// ExtraHost is in the form of name:ip where the ip has to be a valid ip (ipv4 or ipv6).
func ValidateExtraHost(val string) (string, error) {
// allow for IPv6 addresses in extra hosts by only splitting on first ":"
arr := strings.SplitN(val, ":", 2)
Expand Down
11 changes: 6 additions & 5 deletions runconfig/opts/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func Parse(cmd *flag.FlagSet, args []string) (*container.Config, *container.Host
if *flStdin {
attachStdin = true
}
// If -a is not set attach to the output stdio
// If -a is not set, attach to stdout and stderr
if flAttach.Len() == 0 {
attachStdout = true
attachStderr = true
Expand Down Expand Up @@ -246,7 +246,7 @@ func Parse(cmd *flag.FlagSet, args []string) (*container.Config, *container.Host
// Validate if the given hostname is RFC 1123 (https://tools.ietf.org/html/rfc1123) compliant.
hostname := *flHostname
if hostname != "" {
// Linux hostname is limited to HOST_NAME_MAX=64, not not including the terminating null byte.
// Linux hostname is limited to HOST_NAME_MAX=64, not including the terminating null byte.
matched, _ := regexp.MatchString("^(([[:alnum:]]|[[:alnum:]][[:alnum:]\\-]*[[:alnum:]])\\.)*([[:alnum:]]|[[:alnum:]][[:alnum:]\\-]*[[:alnum:]])$", hostname)
if len(hostname) > 64 || !matched {
return nil, nil, nil, cmd, fmt.Errorf("invalid hostname format for --hostname: %s", hostname)
Expand Down Expand Up @@ -473,7 +473,8 @@ func Parse(cmd *flag.FlagSet, args []string) (*container.Config, *container.Host
return config, hostConfig, networkingConfig, cmd, nil
}

// reads a file of line terminated key=value pairs and override that with override parameter
// reads a file of line terminated key=value pairs, and overrides any keys
// present in the file with additional pairs specified in the override parameter
func readKVStrings(files []string, override []string) ([]string, error) {
envVariables := []string{}
for _, ef := range files {
Expand Down Expand Up @@ -539,7 +540,7 @@ func parseSecurityOpts(securityOpts []string) ([]string, error) {
return securityOpts, nil
}

// parse storage options per container into a map
// parses storage options per container into a map
func parseStorageOpts(storageOpts []string) (map[string]string, error) {
m := make(map[string]string)
for _, option := range storageOpts {
Expand Down Expand Up @@ -640,7 +641,7 @@ func ParseLink(val string) (string, string, error) {
if len(arr) == 1 {
return val, val, nil
}
// This is kept because we can actually get an HostConfig with links
// This is kept because we can actually get a HostConfig with links
// from an already created container and the format is not `foo:bar`
// but `/foo:/c1/bar`
if strings.HasPrefix(arr[0], "/") {
Expand Down

0 comments on commit 81b01b4

Please sign in to comment.