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 <matthew.heon@pm.me>
This commit is contained in:
Matthew Heon
2019-03-28 14:28:10 -04:00
parent 850326cc19
commit 449b8ab7b1

View File

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