Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
16e645c6
Commit
16e645c6
authored
Mar 24, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove container_registry method from project class
parent
4fdcaca6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
40 deletions
+3
-40
app/models/project.rb
app/models/project.rb
+0
-14
spec/models/project_spec.rb
spec/models/project_spec.rb
+3
-26
No files found.
app/models/project.rb
View file @
16e645c6
...
...
@@ -405,20 +405,6 @@ class Project < ActiveRecord::Base
@repository
||=
Repository
.
new
(
path_with_namespace
,
self
)
end
def
container_registry
return
unless
Gitlab
.
config
.
registry
.
enabled
@container_registry
||=
begin
token
=
Auth
::
ContainerRegistryAuthenticationService
.
full_access_token
(
project
)
url
=
Gitlab
.
config
.
registry
.
api_url
host_port
=
Gitlab
.
config
.
registry
.
host_port
# TODO, move configuration vars into ContainerRegistry::Registry, clean
# this method up afterwards
ContainerRegistry
::
Registry
.
new
(
url
,
token:
token
,
path:
host_port
)
end
end
def
container_registry_url
if
Gitlab
.
config
.
registry
.
enabled
"
#{
Gitlab
.
config
.
registry
.
host_port
}
/
#{
path_with_namespace
.
downcase
}
"
...
...
spec/models/project_spec.rb
View file @
16e645c6
...
...
@@ -1389,25 +1389,6 @@ describe Project, models: true do
end
end
describe
'#container_registry_path_with_namespace'
do
let
(
:project
)
{
create
(
:empty_project
,
path:
'PROJECT'
)
}
subject
{
project
.
container_registry_path_with_namespace
}
it
{
is_expected
.
not_to
eq
(
project
.
path_with_namespace
)
}
it
{
is_expected
.
to
eq
(
project
.
path_with_namespace
.
downcase
)
}
end
describe
'#container_registry'
do
let
(
:project
)
{
create
(
:empty_project
)
}
before
{
stub_container_registry_config
(
enabled:
true
)
}
subject
{
project
.
container_registry
}
it
{
is_expected
.
not_to
be_nil
}
end
describe
'#container_registry_url'
do
let
(
:project
)
{
create
(
:empty_project
)
}
...
...
@@ -1417,10 +1398,8 @@ describe Project, models: true do
context
'for enabled registry'
do
let
(
:registry_settings
)
do
{
enabled:
true
,
host_port:
'example.com'
,
}
{
enabled:
true
,
host_port:
'example.com'
}
end
it
{
is_expected
.
not_to
be_nil
}
...
...
@@ -1428,9 +1407,7 @@ describe Project, models: true do
context
'for disabled registry'
do
let
(
:registry_settings
)
do
{
enabled:
false
}
{
enabled:
false
}
end
it
{
is_expected
.
to
be_nil
}
...
...
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