diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-07-19 11:30:57 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-07-19 11:30:57 +0300 |
commit | 9f36012e026845e87c39d5f142abbaa44bde8f2b (patch) | |
tree | 41a6911277510ca880dd7491f2a91524046435f1 /lib/gitlab | |
parent | 9e5c8e5d7f81b88998c8def2f4a20d54eeee49d0 (diff) |
Fix docker tag reference routing constraints
Diffstat (limited to 'lib/gitlab')
-rw-r--r-- | lib/gitlab/regex.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/gitlab/regex.rb b/lib/gitlab/regex.rb index c1ee20b6977..4b3666b3e46 100644 --- a/lib/gitlab/regex.rb +++ b/lib/gitlab/regex.rb @@ -19,17 +19,19 @@ module Gitlab "It must start with letter, digit, emoji or '_'." end - def container_registry_reference_regex - Gitlab::PathRegex.git_reference_regex - end - ## - # Docker Distribution Registry 2.4.1 repository name rules + # Docker Distribution Registry repository / tag name rules + # + # See https://github.com/docker/distribution/blob/master/reference/regexp.go. # def container_repository_name_regex @container_repository_regex ||= %r{\A[a-z0-9]+(?:[-._/][a-z0-9]+)*\Z} end + def container_registry_tag_regex + @container_registry_tag_regex ||= /[\w][\w.-]{0,127}/ + end + def environment_name_regex_chars 'a-zA-Z0-9_/\\$\\{\\}\\. -' end |