diff --git a/identifiers/validate.go b/identifiers/validate.go index c0dd820ff..f52317b49 100644 --- a/identifiers/validate.go +++ b/identifiers/validate.go @@ -42,13 +42,13 @@ var ( identifierRe = regexp.MustCompile(reAnchor(alphanum + reGroup(separators+reGroup(alphanum)) + "*")) ) -// Validate return nil if the string s is a valid identifier. +// Validate returns nil if the string s is a valid identifier. // -// identifiers must be valid domain names according to RFC 1035, section 2.3.1. To -// enforce case insensitivity, all characters must be lower case. +// identifiers are similar to the domain name rules according to RFC 1035, section 2.3.1. However +// rules in this package are relaxed to allow numerals to follow period (".") and mixed case is +// allowed. // -// In general, identifiers that pass this validation, should be safe for use as -// a domain names or filesystem path component. +// In general identifiers that pass this validation should be safe for use as filesystem path components. func Validate(s string) error { if len(s) == 0 { return errors.Wrapf(errdefs.ErrInvalidArgument, "identifier must not be empty") diff --git a/identifiers/validate_test.go b/identifiers/validate_test.go index 5a071fee9..77f926c0c 100644 --- a/identifiers/validate_test.go +++ b/identifiers/validate_test.go @@ -34,6 +34,7 @@ func TestValidIdentifiers(t *testing.T) { "swarmkit.docker.io", "0912341234", "task.0.0123456789", + "container.system-75-f19a.00", "underscores_are_allowed", strings.Repeat("a", maxLength), } {