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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
6e58e7ff
Commit
6e58e7ff
authored
Jun 01, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use downcased path to container repository as this is expected path by Docker
parent
5a377d20
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
3 deletions
+18
-3
CHANGELOG
CHANGELOG
+1
-0
app/models/project.rb
app/models/project.rb
+3
-3
spec/models/project_spec.rb
spec/models/project_spec.rb
+14
-0
No files found.
CHANGELOG
View file @
6e58e7ff
...
...
@@ -21,6 +21,7 @@ v 8.9.0 (unreleased)
- Fix bug when sorting issues by milestone due date and filtering by two or more labels
- Remove 'main language' feature
- Pipelines can be canceled only when there are running builds
- Use downcased path to container repository as this is expected path by Docker
- Projects pending deletion will render a 404 page
- Measure queue duration between gitlab-workhorse and Rails
- Make authentication service for Container Registry to be compatible with < Docker 1.11
...
...
app/models/project.rb
View file @
6e58e7ff
...
...
@@ -313,17 +313,17 @@ class Project < ActiveRecord::Base
return
unless
Gitlab
.
config
.
registry
.
enabled
@container_registry_repository
||=
begin
token
=
Auth
::
ContainerRegistryAuthenticationService
.
full_access_token
(
path_with_namespace
)
token
=
Auth
::
ContainerRegistryAuthenticationService
.
full_access_token
(
path_with_namespace
.
downcase
)
url
=
Gitlab
.
config
.
registry
.
api_url
host_port
=
Gitlab
.
config
.
registry
.
host_port
registry
=
ContainerRegistry
::
Registry
.
new
(
url
,
token:
token
,
path:
host_port
)
registry
.
repository
(
path_with_namespace
)
registry
.
repository
(
path_with_namespace
.
downcase
)
end
end
def
container_registry_repository_url
if
Gitlab
.
config
.
registry
.
enabled
"
#{
Gitlab
.
config
.
registry
.
host_port
}
/
#{
path_with_namespace
}
"
"
#{
Gitlab
.
config
.
registry
.
host_port
}
/
#{
path_with_namespace
.
downcase
}
"
end
end
...
...
spec/models/project_spec.rb
View file @
6e58e7ff
...
...
@@ -792,6 +792,13 @@ describe Project, models: true do
subject
{
project
.
container_registry_repository
}
it
{
is_expected
.
not_to
be_nil
}
context
'for uppercase project path'
do
let
(
:project
)
{
create
(
:empty_project
,
path:
'PROJECT'
)
}
it
{
expect
(
subject
.
path
).
not_to
end_with
(
project
.
path
)
}
it
{
expect
(
subject
.
path
).
to
end_with
(
project
.
path
.
downcase
)
}
end
end
describe
'#container_registry_repository_url'
do
...
...
@@ -810,6 +817,13 @@ describe Project, models: true do
end
it
{
is_expected
.
not_to
be_nil
}
context
'for uppercase project path'
do
let
(
:project
)
{
create
(
:empty_project
,
path:
'PROJECT'
)
}
it
{
is_expected
.
not_to
end_with
(
project
.
path
)
}
it
{
is_expected
.
to
end_with
(
project
.
path
.
downcase
)
}
end
end
context
'for disabled registry'
do
...
...
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