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

Fix abilities

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