BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
08396be6
Commit
08396be6
authored
May 09, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename ImageRegistry to ContainerRegistry
parent
565a5e36
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
21 additions
and
22 deletions
+21
-22
container_registry_controller.rb
app/controllers/projects/container_registry_controller.rb
+3
-6
project.rb
app/models/project.rb
+5
-3
blob.rb
lib/container_registry/blob.rb
+1
-1
client.rb
lib/container_registry/client.rb
+1
-1
config.rb
lib/container_registry/config.rb
+1
-1
registry.rb
lib/container_registry/registry.rb
+3
-3
repository.rb
lib/container_registry/repository.rb
+3
-3
tag.rb
lib/container_registry/tag.rb
+4
-4
No files found.
app/controllers/projects/container_registry_controller.rb
View file @
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
View file @
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
View file @
08396be6
module
Image
Registry
module
Container
Registry
class
Blob
attr_reader
:repository
,
:config
...
...
lib/
image
_registry/client.rb
→
lib/
container
_registry/client.rb
View file @
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
View file @
08396be6
module
Image
Registry
module
Container
Registry
class
Config
attr_reader
:tag
,
:blob
,
:data
...
...
lib/
image
_registry/registry.rb
→
lib/
container
_registry/registry.rb
View file @
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
View file @
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
View file @
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment