summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-05-14 14:22:10 -0500
committerKamil Trzcinski <ayufan@ayufan.eu>2016-05-14 14:22:10 -0500
commit284dc3285a4ec2a626e90b16ca3d372eed82d349 (patch)
tree0c08a12a9153cf606168d1f4290fa151b475bda2
parentee725db8e0f5d95c14031bd939a414e068497bb4 (diff)
downloadgitlab-ce-284dc3285a4ec2a626e90b16ca3d372eed82d349.tar.gz
Fix abilities
-rw-r--r--app/models/ability.rb2
-rw-r--r--app/models/project.rb10
-rw-r--r--app/views/projects/container_registry/index.html.haml2
-rw-r--r--spec/requests/ci/api/runners_spec.rb1
4 files changed, 7 insertions, 8 deletions
diff --git a/app/models/ability.rb b/app/models/ability.rb
index 09dea54689e..74321240468 100644
--- a/app/models/ability.rb
+++ b/app/models/ability.rb
@@ -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
diff --git a/app/models/project.rb b/app/models/project.rb
index 0206ccc8d37..ed7719ed31c 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -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
diff --git a/app/views/projects/container_registry/index.html.haml b/app/views/projects/container_registry/index.html.haml
index ea7c4faaaec..990253719bf 100644
--- a/app/views/projects/container_registry/index.html.haml
+++ b/app/views/projects/container_registry/index.html.haml
@@ -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
diff --git a/spec/requests/ci/api/runners_spec.rb b/spec/requests/ci/api/runners_spec.rb
index db8189ffb79..43f9fe89c8e 100644
--- a/spec/requests/ci/api/runners_spec.rb
+++ b/spec/requests/ci/api/runners_spec.rb
@@ -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