summaryrefslogtreecommitdiff
path: root/spec/lib/container_registry
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-11-16 09:31:07 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-11-16 09:31:07 +0100
commitf4df4f9e3504f0f2fd7acf86087aa0e22177e981 (patch)
treed9da74d9b1a1bc1398e06ed4092c525b195f2935 /spec/lib/container_registry
parenta248bb769f40937e93e8050f3ababb9066115940 (diff)
downloadgitlab-ce-f4df4f9e3504f0f2fd7acf86087aa0e22177e981.tar.gz
Update container repository path reference
We should allow to use double underscore in the path, and it seems that our container repository path regexp was outdated. See https://github.com/docker/distribution/blob/master/reference/regexp.go
Diffstat (limited to 'spec/lib/container_registry')
-rw-r--r--spec/lib/container_registry/path_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/lib/container_registry/path_spec.rb b/spec/lib/container_registry/path_spec.rb
index 84cacdd3f0d..010deae822c 100644
--- a/spec/lib/container_registry/path_spec.rb
+++ b/spec/lib/container_registry/path_spec.rb
@@ -86,6 +86,24 @@ describe ContainerRegistry::Path do
it { is_expected.to be_valid }
end
+
+ context 'when path contains double underscore' do
+ let(:path) { 'my/repository__name' }
+
+ it { is_expected.to be_valid }
+ end
+
+ context 'when path contains invalid separator with dot' do
+ let(:path) { 'some/registry-.name' }
+
+ it { is_expected.not_to be_valid }
+ end
+
+ context 'when path contains invalid separator with underscore' do
+ let(:path) { 'some/registry._name' }
+
+ it { is_expected.not_to be_valid }
+ end
end
describe '#has_repository?' do