diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-17 19:05:49 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-17 19:05:49 +0300 |
commit | 43a25d93ebdabea52f99b05e15b06250cd8f07d7 (patch) | |
tree | dceebdc68925362117480a5d672bcff122fb625b /config/object_store_settings.rb | |
parent | 20c84b99005abd1c82101dfeff264ac50d2df211 (diff) |
Add latest changes from gitlab-org/gitlab@16-0-stable-eev16.0.0-rc42
Diffstat (limited to 'config/object_store_settings.rb')
-rw-r--r-- | config/object_store_settings.rb | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/config/object_store_settings.rb b/config/object_store_settings.rb index 58d7ea22231..615b13d59ca 100644 --- a/config/object_store_settings.rb +++ b/config/object_store_settings.rb @@ -20,7 +20,7 @@ class ObjectStoreSettings # Legacy parser def self.legacy_parse(object_store, object_store_type) - object_store ||= Settingslogic.new({}) + object_store ||= GitlabSettings::Options.build({}) object_store['enabled'] = false if object_store['enabled'].nil? object_store['remote_directory'], object_store['bucket_prefix'] = split_bucket_prefix( object_store['remote_directory'] @@ -162,7 +162,7 @@ class ObjectStoreSettings ) target_config['consolidated_settings'] = true section['object_store'] = target_config - # Settingslogic internally stores data as a Hash, but it also + # GitlabSettings::Options internally stores data as a Hash, but it also # creates a Settings object for every key. To avoid confusion, we should # update both so that Settings.artifacts and Settings['artifacts'] return # the same result. @@ -178,23 +178,11 @@ class ObjectStoreSettings # 1. The common settings are defined # 2. The legacy settings are not defined def use_consolidated_settings? - # to_h is needed because we define `default` as a Gitaly storage name - # in stub_storage_settings. This causes Settingslogic to redefine Hash#default, - # which causes Hash#dig to fail when the key doesn't exist: https://gitlab.com/gitlab-org/gitlab/-/issues/286873 - settings_h = settings.to_h - return false unless settings_h.dig('object_store', 'enabled') - return false unless settings_h.dig('object_store', 'connection').present? + return false unless settings.dig('object_store', 'enabled') + return false unless settings.dig('object_store', 'connection').present? WORKHORSE_ACCELERATED_TYPES.each do |store| - # to_h is needed because we define `default` as a Gitaly storage name - # in stub_storage_settings. This causes Settingslogic to redefine Hash#default, - # which causes Hash#dig to fail when the key doesn't exist: https://gitlab.com/gitlab-org/gitlab/-/issues/286873 - # - # (byebug) section.dig - # *** ArgumentError Exception: wrong number of arguments (given 0, expected 1+) - # (byebug) section.dig('object_store') - # *** ArgumentError Exception: wrong number of arguments (given 1, expected 0) - section = settings.try(store)&.to_h + section = settings.try(store) next unless section |