diff options
author | Andre Guedes <andrebsguedes@gmail.com> | 2016-11-02 00:33:35 -0200 |
---|---|---|
committer | Andre Guedes <andrebsguedes@gmail.com> | 2017-02-22 11:29:06 -0300 |
commit | dcd4beb8eb7bb7d0c2f720ef85c3da9f97a3dfe6 (patch) | |
tree | 53cc8f6d1f055a88aec411608cba51460b001e1c /lib/container_registry | |
parent | e43b2e81dab3cade773d479f2ae56478e3113207 (diff) | |
download | gitlab-ce-dcd4beb8eb7bb7d0c2f720ef85c3da9f97a3dfe6.tar.gz |
Multi-level container image names backend implementation
- Adds Registry events API endpoint
- Adds container_images_repository and container_images models
- Changes JWT authentication to allow multi-level scopes
- Adds services for container image maintenance
Diffstat (limited to 'lib/container_registry')
-rw-r--r-- | lib/container_registry/client.rb | 4 | ||||
-rw-r--r-- | lib/container_registry/tag.rb | 8 |
2 files changed, 7 insertions, 5 deletions
diff --git a/lib/container_registry/client.rb b/lib/container_registry/client.rb index 2edddb84fc3..2cbb7bfb67d 100644 --- a/lib/container_registry/client.rb +++ b/lib/container_registry/client.rb @@ -15,6 +15,10 @@ module ContainerRegistry @options = options end + def update_token(token) + @options[:token] = token + end + def repository_tags(name) response_body faraday.get("/v2/#{name}/tags/list") end diff --git a/lib/container_registry/tag.rb b/lib/container_registry/tag.rb index 59040199920..68dd87c979d 100644 --- a/lib/container_registry/tag.rb +++ b/lib/container_registry/tag.rb @@ -22,9 +22,7 @@ module ContainerRegistry end def manifest - return @manifest if defined?(@manifest) - - @manifest = client.repository_manifest(repository.name, name) + @manifest ||= client.repository_manifest(repository.name_with_namespace, name) end def path @@ -40,7 +38,7 @@ module ContainerRegistry def digest return @digest if defined?(@digest) - @digest = client.repository_tag_digest(repository.name, name) + @digest = client.repository_tag_digest(repository.name_with_namespace, name) end def config_blob @@ -82,7 +80,7 @@ module ContainerRegistry def delete return unless digest - client.delete_repository_tag(repository.name, digest) + client.delete_repository_tag(repository.name_with_namespace, digest) end end end |