diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-06 21:08:49 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-06 21:08:49 +0300 |
commit | 1ca6880aac4a41fe2ae519a87ebfb90470fad7c5 (patch) | |
tree | f01c6ed81a6850f23ee1eb64f09044ce2b57aeba /config/object_store_settings.rb | |
parent | 4d922922a97e5ac6a1617aba00642ad7657d2727 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'config/object_store_settings.rb')
-rw-r--r-- | config/object_store_settings.rb | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/config/object_store_settings.rb b/config/object_store_settings.rb index 0d346135463..767fcd7579c 100644 --- a/config/object_store_settings.rb +++ b/config/object_store_settings.rb @@ -1,8 +1,12 @@ # Set default values for object_store settings class ObjectStoreSettings - SUPPORTED_TYPES = %w(artifacts external_diffs lfs uploads packages dependency_proxy terraform_state).freeze + SUPPORTED_TYPES = %w(artifacts external_diffs lfs uploads packages dependency_proxy terraform_state pages).freeze ALLOWED_OBJECT_STORE_OVERRIDES = %w(bucket enabled proxy_download).freeze + # pages may be enabled but use legacy disk storage + # we don't need to raise an error in that case + ALLOWED_INCOMPLETE_TYPES = %w(pages).freeze + attr_accessor :settings # Legacy parser @@ -115,7 +119,9 @@ class ObjectStoreSettings next unless section - raise "Object storage for #{store_type} must have a bucket specified" if section['enabled'] && target_config['bucket'].blank? + if section['enabled'] && target_config['bucket'].blank? + missing_bucket_for(store_type) + end # Map bucket (external name) -> remote_directory (internal representation) target_config['remote_directory'] = target_config.delete('bucket') @@ -152,4 +158,14 @@ class ObjectStoreSettings true end + + def missing_bucket_for(store_type) + message = "Object storage for #{store_type} must have a bucket specified" + + if ALLOWED_INCOMPLETE_TYPES.include?(store_type) + warn "[WARNING] #{message}" + else + raise message + end + end end |