Merge pull request #21377 from LK4D4/fix_compile

runconfig/opts: fix compilation issue
Upstream-commit: c22d09f56336b31a0569c424957b13f7baf01a92
Component: engine
This commit is contained in:
Tibor Vass
2016-03-21 19:11:09 -04:00

View File

@ -242,6 +242,7 @@ func Parse(cmd *flag.FlagSet, args []string) (*container.Config, *container.Host
entrypoint = strslice.StrSlice{*flEntrypoint}
}
// Validate if the given hostname is RFC 1123 (https://tools.ietf.org/html/rfc1123) compliant.
hostname := *flHostname
if hostname != "" {
matched, _ := regexp.MatchString("^(([[:alnum:]]|[[:alnum:]][[:alnum:]\\-]*[[:alnum:]])\\.)*([[:alnum:]]|[[:alnum:]][[:alnum:]\\-]*[[:alnum:]])$", hostname)
if !matched {