From dc559e048aaac5f187a2ff0f361853abb84f5c2a Mon Sep 17 00:00:00 2001 From: Victor Vieux Date: Tue, 27 May 2014 21:03:12 +0000 Subject: [PATCH] improve numeric only id detection Docker-DCO-1.1-Signed-off-by: Victor Vieux (github: vieux) Upstream-commit: f2baa364a13ea3e22719e3637bf6f5f42e5dc677 Component: engine --- components/engine/utils/utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/engine/utils/utils.go b/components/engine/utils/utils.go index 1a140f650d..0495dc6fa8 100644 --- a/components/engine/utils/utils.go +++ b/components/engine/utils/utils.go @@ -514,7 +514,7 @@ func GenerateRandomID() string { // if we try to parse the truncated for as an int and we don't have // an error then the value is all numberic and causes issues when // used as a hostname. ref #3869 - if _, err := strconv.Atoi(TruncateID(value)); err == nil { + if _, err := strconv.ParseInt(TruncateID(value), 10, 64); err == nil { continue } return value