mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
This commit is contained in:
parent
8eb8a1d6b8
commit
34700cc1f3
3 changed files with 8 additions and 7 deletions
|
@ -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) {
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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], "/") {
|
||||
|
|
Loading…
Add table
Reference in a new issue