ContainerRegistry::Path::InvalidRegistryPathError on previous valid container registry names
Created by @stanhu.
It appears the introduction of multi-level container images in gitlab-ce!10109 may have broken previously valid path names:
irb(main):003:0> reg = ContainerRegistry::Path.new(proj.full_path)
=> #<ContainerRegistry::Path:0x007ff62d081c88 @path="redacted.name/Redacted_Controller">
irb(main):004:0> reg.valid?
=> nil
irb(main):005:0> Gitlab::Regex.container_repository_name_regex
=> /\A[a-z0-9]+(?:[-._\/][a-z0-9]+)*\Z/
https://sentry.gitlap.com/gitlab/gitlabcom/issues/26782/
ContainerRegistry::Path::InvalidRegistryPathError: ContainerRegistry::Path::InvalidRegistryPathError
lib/container_registry/path.rb:32:in `nodes'
raise InvalidRegistryPathError unless valid?
lib/container_registry/path.rb:56:in `repository_project'
.where_full_path_in(nodes.first(LEVELS_SUPPORTED))
lib/container_registry/path.rb:40:in `has_project?'
repository_project.present?
lib/container_registry/path.rb:44:in `has_repository?'
return false unless has_project?
app/controllers/projects/registry/repositories_controller.rb:34:in `block in ensure_root_container_repository!'
break if path.has_repository?
...
(102 additional frame(s) were not displayed)
ContainerRegistry::Path::InvalidRegistryPathError: ContainerRegistry::Path::InvalidRegistryPathError