diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-03 18:09:25 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-03 18:09:25 +0000 |
commit | 174343966742d2f4b87ac84f9ce4ee576cb9d75e (patch) | |
tree | 265908b79177da98dcd58cac300d81090416a8ee /config/object_store_settings.rb | |
parent | 6cbb93596d65dff377372f4b50da932dcf6dc514 (diff) | |
download | gitlab-ce-174343966742d2f4b87ac84f9ce4ee576cb9d75e.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'config/object_store_settings.rb')
-rw-r--r-- | config/object_store_settings.rb | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/config/object_store_settings.rb b/config/object_store_settings.rb index 5603ea51672..f92bffd45db 100644 --- a/config/object_store_settings.rb +++ b/config/object_store_settings.rb @@ -124,9 +124,12 @@ class ObjectStoreSettings target_config = common_config.merge(overrides.slice(*ALLOWED_OBJECT_STORE_OVERRIDES)) section = settings.try(store_type) - next unless uses_object_storage?(section) + # Admins can selectively disable object storage for a specific + # type as an override in the consolidated settings. + next unless overrides.fetch('enabled', true) + next unless section - if target_config['bucket'].blank? + if section['enabled'] && target_config['bucket'].blank? missing_bucket_for(store_type) next end @@ -146,20 +149,6 @@ class ObjectStoreSettings private - # Admins can selectively disable object storage for a specific type. If - # this hasn't been set, we assume that the consolidated settings - # should be used. - def uses_object_storage?(section) - # Use to_h to avoid https://gitlab.com/gitlab-org/gitlab/-/issues/286873 - section = section.to_h - - enabled_globally = section.fetch('enabled', false) - object_store_settings = section.fetch('object_store', {}) - os_enabled = object_store_settings.fetch('enabled', true) - - enabled_globally && os_enabled - end - # We only can use the common object storage settings if: # 1. The common settings are defined # 2. The legacy settings are not defined |