From 449b8ab7b14fcc0d9e3badbe14b09f387c2c459c Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Thu, 28 Mar 2019 14:28:10 -0400 Subject: Alter container/pod/volume name regexp to match Docker Docker's upstream name validation regex has two major differences from ours that we pick up in this PR. The first requires that the first character of a name is a letter or number, not a special character. The second allows periods in names. Signed-off-by: Matthew Heon --- libpod/options.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpod/options.go b/libpod/options.go index 3ca80e96c..14c21815f 100644 --- a/libpod/options.go +++ b/libpod/options.go @@ -17,7 +17,7 @@ import ( ) var ( - nameRegex = regexp.MustCompile("[a-zA-Z0-9_-]+") + nameRegex = regexp.MustCompile("^[a-zA-Z0-9][a-zA-Z0-9_.-]*$") ) // Runtime Creation Options -- cgit v1.2.3-54-g00ecf