Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
08396be6
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
08396be6
编写于
5月 09, 2016
作者:
K
Kamil Trzcinski
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rename ImageRegistry to ContainerRegistry
上级
565a5e36
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
21 addition
and
22 deletion
+21
-22
app/controllers/projects/container_registry_controller.rb
app/controllers/projects/container_registry_controller.rb
+3
-6
app/models/project.rb
app/models/project.rb
+5
-3
lib/container_registry/blob.rb
lib/container_registry/blob.rb
+1
-1
lib/container_registry/client.rb
lib/container_registry/client.rb
+1
-1
lib/container_registry/config.rb
lib/container_registry/config.rb
+1
-1
lib/container_registry/registry.rb
lib/container_registry/registry.rb
+3
-3
lib/container_registry/repository.rb
lib/container_registry/repository.rb
+3
-3
lib/container_registry/tag.rb
lib/container_registry/tag.rb
+4
-4
未找到文件。
app/controllers/projects/container_registry_controller.rb
浏览文件 @
08396be6
...
...
@@ -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_regist
ry
def
container_registry
_repository
@container_registry
_repository
||=
project
.
container_registry_reposito
ry
end
def
tag
...
...
app/models/project.rb
浏览文件 @
08396be6
...
...
@@ -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
...
...
lib/
image
_registry/blob.rb
→
lib/
container
_registry/blob.rb
浏览文件 @
08396be6
module
Image
Registry
module
Container
Registry
class
Blob
attr_reader
:repository
,
:config
...
...
lib/
image
_registry/client.rb
→
lib/
container
_registry/client.rb
浏览文件 @
08396be6
require
'faraday'
require
'faraday_middleware'
module
Image
Registry
module
Container
Registry
class
Client
attr_accessor
:uri
...
...
lib/
image
_registry/config.rb
→
lib/
container
_registry/config.rb
浏览文件 @
08396be6
module
Image
Registry
module
Container
Registry
class
Config
attr_reader
:tag
,
:blob
,
:data
...
...
lib/
image
_registry/registry.rb
→
lib/
container
_registry/registry.rb
浏览文件 @
08396be6
module
Image
Registry
module
Container
Registry
class
Registry
attr_reader
:uri
,
:client
def
initialize
(
uri
,
options
=
{})
@uri
=
URI
.
parse
(
uri
)
@client
=
Image
Registry
::
Client
.
new
(
uri
,
options
)
@client
=
Container
Registry
::
Client
.
new
(
uri
,
options
)
end
def
[]
(
name
)
Image
Registry
::
Repository
.
new
(
self
,
name
)
Container
Registry
::
Repository
.
new
(
self
,
name
)
end
end
end
lib/
image
_registry/repository.rb
→
lib/
container
_registry/repository.rb
浏览文件 @
08396be6
module
Image
Registry
module
Container
Registry
class
Repository
attr_reader
:registry
,
:name
...
...
@@ -11,7 +11,7 @@ module ImageRegistry
end
def
[]
(
tag
)
Image
Registry
::
Tag
.
new
(
self
,
tag
)
Container
Registry
::
Tag
.
new
(
self
,
tag
)
end
def
manifest
...
...
@@ -27,7 +27,7 @@ module ImageRegistry
return
@tags
if
defined?
(
@tags
)
return
[]
unless
manifest
&&
manifest
[
'tags'
]
@tags
=
manifest
[
'tags'
].
map
do
|
tag
|
Image
Registry
::
Tag
.
new
(
self
,
tag
)
Container
Registry
::
Tag
.
new
(
self
,
tag
)
end
@tags
||=
[]
end
...
...
lib/
image
_registry/tag.rb
→
lib/
container
_registry/tag.rb
浏览文件 @
08396be6
module
Image
Registry
module
Container
Registry
class
Tag
attr_reader
:repository
,
:name
...
...
@@ -28,12 +28,12 @@ module ImageRegistry
def
config_blob
return
@config_blob
if
defined?
(
@config_blob
)
return
unless
manifest
&&
manifest
[
'config'
]
@config_blob
=
Image
Registry
::
Blob
.
new
(
repository
,
manifest
[
'config'
])
@config_blob
=
Container
Registry
::
Blob
.
new
(
repository
,
manifest
[
'config'
])
end
def
config
return
unless
config_blob
@config
||=
Image
Registry
::
Config
.
new
(
self
,
config_blob
)
@config
||=
Container
Registry
::
Config
.
new
(
self
,
config_blob
)
end
def
created_at
...
...
@@ -45,7 +45,7 @@ module ImageRegistry
return
@layers
if
defined?
(
@layers
)
return
unless
manifest
@layers
=
manifest
[
'layers'
].
map
do
|
layer
|
Image
Registry
::
Blob
.
new
(
repository
,
layer
)
Container
Registry
::
Blob
.
new
(
repository
,
layer
)
end
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录