From 7ec3c2dcee9da79dfa8d034377fe9462ff8e5b0b Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Mon, 10 Apr 2017 13:07:36 +0200 Subject: [PATCH] Add method that returns location of registry image --- lib/container_registry/tag.rb | 4 ++++ spec/lib/container_registry/tag_spec.rb | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/lib/container_registry/tag.rb b/lib/container_registry/tag.rb index d00e6191e7e..728deea224f 100644 --- a/lib/container_registry/tag.rb +++ b/lib/container_registry/tag.rb @@ -29,6 +29,10 @@ module ContainerRegistry "#{repository.path}:#{name}" end + def location + "#{repository.location}:#{name}" + end + def [](key) return unless manifest diff --git a/spec/lib/container_registry/tag_spec.rb b/spec/lib/container_registry/tag_spec.rb index bc1912d8e6c..f8fffbdca41 100644 --- a/spec/lib/container_registry/tag_spec.rb +++ b/spec/lib/container_registry/tag_spec.rb @@ -50,6 +50,13 @@ describe ContainerRegistry::Tag do end end + describe '#location' do + it 'returns a full location of the tag' do + expect(tag.location) + .to eq 'registry.gitlab/group/test:tag' + end + end + context 'manifest processing' do context 'schema v1' do before do