Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'config/object_store_settings.rb')
-rw-r--r--config/object_store_settings.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/config/object_store_settings.rb b/config/object_store_settings.rb
index 283cd952c04..4e9a7148e15 100644
--- a/config/object_store_settings.rb
+++ b/config/object_store_settings.rb
@@ -50,6 +50,24 @@ class ObjectStoreSettings
[bucket, prefix]
end
+ def self.enabled_endpoint_uris
+ SUPPORTED_TYPES.filter_map do |type|
+ section_setting = Gitlab.config.try(type)
+
+ next unless section_setting && section_setting['enabled']
+
+ object_store_setting = section_setting['object_store']
+
+ next unless object_store_setting && object_store_setting['enabled']
+
+ endpoint = object_store_setting.dig('connection', 'endpoint')
+
+ next unless endpoint
+
+ URI(endpoint)
+ end.uniq
+ end
+
def initialize(settings)
@settings = settings
end