lib/fog/azurerm/storage.rb in gitlab-fog-azure-rm-0.7.0 vs lib/fog/azurerm/storage.rb in gitlab-fog-azure-rm-0.8.0

- old
+ new

@@ -10,10 +10,12 @@ recognizes :environment # Recognizes when creating data client recognizes :azure_storage_account_name recognizes :azure_storage_access_key + recognizes :azure_storage_domain + recognizes :debug request_path 'fog/azurerm/requests/storage' # Azure Storage Container requests request :create_container @@ -102,13 +104,21 @@ return unless @azure_storage_account_name != options[:azure_storage_account_name] || @azure_storage_access_key != options[:azure_storage_access_key] @azure_storage_account_name = options[:azure_storage_account_name] @azure_storage_access_key = options[:azure_storage_access_key] + @azure_storage_domain = options[:azure_storage_domain] + domain = + if @azure_storage_domain.nil? || @azure_storage_domain.empty? + get_blob_endpoint(@azure_storage_account_name, true, @environment) + else + get_blob_endpoint_with_domain(@azure_storage_account_name, true, @azure_storage_domain) + end + azure_client = Azure::Storage::Client.create(storage_account_name: @azure_storage_account_name, storage_access_key: @azure_storage_access_key) - azure_client.storage_blob_host = get_blob_endpoint(@azure_storage_account_name, true, @environment) + azure_client.storage_blob_host = domain @blob_client = azure_client.blob_client @blob_client.with_filter(Azure::Storage::Core::Filter::ExponentialRetryPolicyFilter.new) @blob_client.with_filter(Azure::Core::Http::DebugFilter.new) if @debug @signature_client = Azure::Storage::Core::Auth::SharedAccessSignature.new(@azure_storage_account_name, @azure_storage_access_key)