1
0
mirror of https://github.com/docker/cli.git synced 2026-01-23 15:21:32 +03:00

Merge pull request #6063 from vieux/improve_number_detection

improve numeric only id detection
Upstream-commit: 70c6d806c8f43a91a324a352f69648a47c843335
Component: engine
This commit is contained in:
unclejack
2014-05-28 00:36:57 +03:00

View File

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