summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-05-09 22:14:46 +0300
committerKamil Trzcinski <ayufan@ayufan.eu>2016-05-09 22:14:46 +0300
commit08396be619eee2e71c2f5f7aa27eea6f5ddf10ff (patch)
tree57377cb67bcc8e9eb9d221e24f167485f3e1ed11 /app
parent565a5e36fc456831fd08e0627a936855d87eb932 (diff)
downloadgitlab-ce-08396be619eee2e71c2f5f7aa27eea6f5ddf10ff.tar.gz
Rename ImageRegistry to ContainerRegistry
Diffstat (limited to 'app')
-rw-r--r--app/controllers/projects/container_registry_controller.rb9
-rw-r--r--app/models/project.rb8
2 files changed, 8 insertions, 9 deletions
diff --git a/app/controllers/projects/container_registry_controller.rb b/app/controllers/projects/container_registry_controller.rb
index ffd455e6476..94f7580f0ea 100644
--- a/app/controllers/projects/container_registry_controller.rb
+++ b/app/controllers/projects/container_registry_controller.rb
@@ -5,10 +5,7 @@ class Projects::ContainerRegistryController < Projects::ApplicationController
layout 'project'
def index
- @tags = container_registry.tags
-
- other_repository = container_registry.registry["gitlab/gitlab-test3"]
- container_registry.copy_to(other_repository)
+ @tags = container_registry_repository.tags
end
def destroy
@@ -21,8 +18,8 @@ class Projects::ContainerRegistryController < Projects::ApplicationController
private
- def container_registry
- @container_registry ||= project.container_registry
+ def container_registry_repository
+ @container_registry_repository ||= project.container_registry_repository
end
def tag
diff --git a/app/models/project.rb b/app/models/project.rb
index f81d9a52628..d384c58ca36 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -376,9 +376,11 @@ class Project < ActiveRecord::Base
end
def container_registry
- @registry_token ||= Jwt::DockerAuthenticationService.full_access_token(path_with_namespace)
- @registry ||= ImageRegistry::Registry.new(Gitlab.config.registry.api_url, token: @registry_token)
- @container_registry ||= ImageRegistry::Repository.new(@registry, path_with_namespace)
+ @container_registry_repository ||= begin
+ token = Jwt::ContainerRegistryAuthenticationService.full_access_token(path_with_namespace)
+ registry = ContainerRegistry::Registry.new(Gitlab.config.registry.api_url, token: token)
+ registry[path_with_namespace]
+ end
end
def container_registry_url