Commit 845f9c31 authored by Douwe Maan's avatar Douwe Maan

Merge branch 'bug/geo-current-node' into 'master'

Fix error in admin dashboard when Geo is enabled and current node is nil.

Fixes the error in Dashboard when Geo (#76) is enabled and `current_node` is `nil`
Same fix is also applied to `rake gitlab:env:info`.

This will fix #785

See merge request !561
parents b1ed8d8d e85b2e15
......@@ -7,6 +7,9 @@ v 8.10.0 (unreleased)
- Isolate EE LDAP library code in EE module (Part 1) !511
- Make Elasticsearch indexer run as an async task
v.8.9.7 (unreleased)
- Fix error in admin dashboard when Geo is enabled and current node is nil.
v 8.9.6
- Avoid adding index for key fingerprint if it already exists. !539
......
......@@ -98,7 +98,10 @@
%p
Geo
%span.pull-right
= Gitlab::Geo.current_node.primary ? 'Primary node' : 'Secondary node'
- if Gitlab::Geo.current_node
= Gitlab::Geo.current_node.primary ? 'Primary node' : 'Secondary node'
- else
Undefined
%p
Git
%span.pull-right
......
......@@ -36,6 +36,13 @@ namespace :gitlab do
http_clone_url = project.http_url_to_repo
ssh_clone_url = project.ssh_url_to_repo
if Gitlab::Geo.current_node
geo_node_type = Gitlab::Geo.current_node.primary ? 'Primary' : 'Secondary'
else
geo_node_type = 'Undefined'.color(:red)
end
omniauth_providers = Gitlab.config.omniauth.providers
omniauth_providers.map! { |provider| provider['name'] }
......@@ -51,7 +58,7 @@ namespace :gitlab do
puts "SSH Clone URL:\t#{ssh_clone_url}"
puts "Elasticsearch:\t#{Gitlab.config.elasticsearch.enabled ? "yes".color(:green) : "no"}"
puts "Geo:\t\t#{Gitlab::Geo.enabled? ? "yes".color(:green) : "no"}"
puts "Geo node:\t#{Gitlab::Geo.current_node.primary ? "Primary" : "Secondary"}" if Gitlab::Geo.enabled?
puts "Geo node:\t#{geo_node_type}" if Gitlab::Geo.enabled?
puts "Using LDAP:\t#{Gitlab.config.ldap.enabled ? "yes".color(:green) : "no"}"
puts "Using Omniauth:\t#{Gitlab.config.omniauth.enabled ? "yes".color(:green) : "no"}"
puts "Omniauth Providers: #{omniauth_providers.join(', ')}" if Gitlab.config.omniauth.enabled
......
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