diff --git a/runconfig/config.go b/runconfig/config.go index 5391e300787c3..d99ebb209050e 100644 --- a/runconfig/config.go +++ b/runconfig/config.go @@ -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) { diff --git a/runconfig/opts/opts.go b/runconfig/opts/opts.go index f919218d6f7ec..b6d2e000e418c 100644 --- a/runconfig/opts/opts.go +++ b/runconfig/opts/opts.go @@ -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) diff --git a/runconfig/opts/parse.go b/runconfig/opts/parse.go index d30adcedc1ed0..44a896d77cf40 100644 --- a/runconfig/opts/parse.go +++ b/runconfig/opts/parse.go @@ -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 @@ -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) @@ -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 { @@ -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 { @@ -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], "/") {