瀏覽代碼

runconfig/opts: fix compilation issue

it was introduced with #20566 as a result of merge

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Alexander Morozov 9 年之前
父節點
當前提交
93f5770511
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      runconfig/opts/parse.go

+ 1 - 0
runconfig/opts/parse.go

@@ -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 {