diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-05-09 18:27:38 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-06-04 14:04:29 +0300 |
commit | b8370c9f55843351b49073dafe84a2e9858c8c8a (patch) | |
tree | a211a5003143c2d2dc9b10e86ce67f58c27a41c9 /config/initializers/direct_upload_support.rb | |
parent | 0b4f9ff4068af6776b495d9332aeecf58e48786f (diff) |
Support presigned multipart uploads
Diffstat (limited to 'config/initializers/direct_upload_support.rb')
-rw-r--r-- | config/initializers/direct_upload_support.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/config/initializers/direct_upload_support.rb b/config/initializers/direct_upload_support.rb new file mode 100644 index 00000000000..8ba1229415f --- /dev/null +++ b/config/initializers/direct_upload_support.rb @@ -0,0 +1,13 @@ +SUPPORTED_DIRECT_UPLOAD_PROVIDERS = %w(Google AWS).freeze + +def verify_provider_support!(object_store) + return unless object_store.enabled + return unless object_store.direct_upload + return if SUPPORTED_DIRECT_UPLOAD_PROVIDERS.include?(object_store.connection&.provider.to_s) + + raise "Only #{SUPPORTED_DIRECT_UPLOAD_PROVIDERS.join(',')} are supported as a object storage provider when 'direct_upload' is used" +end + +verify_provider_support!(Gitlab.config.artifacts.object_store) +verify_provider_support!(Gitlab.config.uploads.object_store) +verify_provider_support!(Gitlab.config.lfs.object_store) |