Commit 284dc328 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Fix abilities

parent ee725db8
...@@ -292,7 +292,7 @@ class Ability ...@@ -292,7 +292,7 @@ class Ability
rules += named_abilities('build') rules += named_abilities('build')
end end
unless project.container_registry_enabled && Gitlab.config.registry.enabled unless project.container_registry_enabled
rules += named_abilities('container_registry') rules += named_abilities('container_registry')
end end
......
...@@ -332,20 +332,20 @@ class Project < ActiveRecord::Base ...@@ -332,20 +332,20 @@ class Project < ActiveRecord::Base
@container_registry_repository ||= begin @container_registry_repository ||= begin
token = Auth::ContainerRegistryAuthenticationService.full_access_token(path_with_namespace) token = Auth::ContainerRegistryAuthenticationService.full_access_token(path_with_namespace)
url = Gitlab.config.registry.api_url url = Gitlab.config.registry.api_url
host_port = Gitlab.config.registry.host_port host = Gitlab.config.registry.host
registry = ContainerRegistry::Registry.new(url, token: token, path: host_port) registry = ContainerRegistry::Registry.new(url, token: token, path: host)
registry[path_with_namespace] registry[path_with_namespace]
end end
end end
def container_registry_repository_url def container_registry_repository_url
if container_registry_enabled? && Gitlab.config.registry.enabled if Gitlab.config.registry.enabled
"#{Gitlab.config.registry.host_port}/#{path_with_namespace}" "#{Gitlab.config.registry.host}/#{path_with_namespace}"
end end
end end
def has_container_registry_tags? def has_container_registry_tags?
if container_registry_enabled? && Gitlab.config.registry.enabled if Gitlab.config.registry.enabled
container_registry_repository.tags.any? container_registry_repository.tags.any?
end end
end end
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
To start using container images hosted on GitLab you first need to login: To start using container images hosted on GitLab you first need to login:
%pre %pre
%code %code
docker login #{Gitlab.config.registry.host_port} docker login #{Gitlab.config.registry.host}
%br %br
Then you are free to create and upload a container image with build and push commands: Then you are free to create and upload a container image with build and push commands:
%pre %pre
......
...@@ -7,7 +7,6 @@ describe Ci::API::API do ...@@ -7,7 +7,6 @@ describe Ci::API::API do
let(:registration_token) { 'abcdefg123456' } let(:registration_token) { 'abcdefg123456' }
before do before do
stub_gitlab_calls
stub_application_setting(runners_registration_token: registration_token) stub_application_setting(runners_registration_token: registration_token)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment