Skip to content

Commit

Permalink
Merge pull request #2552 from s4heid/azure-cloud
Browse files Browse the repository at this point in the history
Make Azure Cloud configurable for director blobstore
  • Loading branch information
jpalermo authored Sep 26, 2024
2 parents 62a32fd + 0b9215f commit 711b40f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions jobs/director/spec
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,9 @@ properties:
description: container_name of azure storage account
blobstore.account_key:
description: account_key of azure storage account
blobstore.azure_cloud_name:
description: Name of the Azure Cloud
default: AzureCloud
blobstore.swift_auth_account:
description: swift_auth_account of swift storage account
blobstore.swift_temp_url_key:
Expand Down
1 change: 1 addition & 0 deletions jobs/director/templates/director.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ elsif p('blobstore.provider') == 'gcs'
end
elsif p('blobstore.provider') == 'azure-storage'
blobstore_options = {
'azure_cloud_name' => p('blobstore.azure_cloud_name'),
'account_name' => p('blobstore.account_name'),
'container_name' => p('blobstore.container_name'),
'account_key' => p('blobstore.account_key'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ class AzurestoragecliBlobstoreClient < BaseClient
# key that is applied before the object is sent to azure storage account
# @option options [Symbol, optional] account_key
# @option options [Symbol, optional] container_name
# @option options [Symbol, optional] azure_cloud_name
# Azure Cloud Name to use for azure storage account
# @option options [Symbol] azure_storage_cli_path
# path to azure-storage-cli binary
# @option options [Symbol, optional] azure_storage_cli_config_path
Expand All @@ -29,7 +31,8 @@ def initialize(options)
@azure_storage_cli_options = {
"account_name": @options[:account_name],
"container_name": @options[:container_name],
"account_key": @options[:account_key]
"account_key": @options[:account_key],
"environment": @options[:azure_cloud_name]
}

@azure_storage_cli_options.reject! { |_k, v| v.nil? }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module Bosh::Blobstore
container_name: 'test',
account_name: 'NAME',
account_key: 'SECRET',
azure_cloud_name: 'foo-cloud',
azure_storage_cli_path: '/var/vcap/packages/azure-storage-cli/bin/azure-storage-cli',
}
end
Expand All @@ -37,7 +38,8 @@ module Bosh::Blobstore
{
'container_name' => 'test',
'account_name' => 'NAME',
'account_key' => 'SECRET'
'account_key' => 'SECRET',
'environment' => 'foo-cloud',
}
end
let(:stored_config_file) { File.new(expected_config_file).readlines }
Expand Down

0 comments on commit 711b40f

Please sign in to comment.