11require 'cloud_controller/blobstore/client'
22require 'cloud_controller/blobstore/retryable_client'
33require 'cloud_controller/blobstore/fog/fog_client'
4- require 'cloud_controller/blobstore/fog/ error_handling_client'
4+ require 'cloud_controller/blobstore/error_handling_client'
55require 'cloud_controller/blobstore/webdav/dav_client'
66require 'cloud_controller/blobstore/safe_delete_client'
7- require 'cloud_controller/blobstore/cli/azure_cli_client '
7+ require 'cloud_controller/blobstore/storage_cli/storage_cli_client '
88require 'google/apis/errors'
99
1010module CloudController
@@ -13,8 +13,11 @@ class ClientProvider
1313 def self . provide ( options :, directory_key :, root_dir : nil , resource_type : nil )
1414 if options [ :blobstore_type ] . blank? || ( options [ :blobstore_type ] == 'fog' )
1515 provide_fog ( options , directory_key , root_dir )
16- elsif options [ :blobstore_type ] == 'cli'
17- provide_azure_cli ( options , directory_key , root_dir )
16+ elsif options [ :blobstore_type ] == 'storage-cli'
17+ provide_storage_cli ( options , directory_key , root_dir )
18+ elsif options [ :blobstore_type ] == 'storage-cli-fork'
19+ # Just for testing not yet merged features in bosh-azure-cli
20+ provide_storage_cli ( options , directory_key , root_dir , fork : true )
1821 else
1922 provide_webdav ( options , directory_key , root_dir )
2023 end
@@ -69,18 +72,17 @@ def provide_webdav(options, directory_key, root_dir)
6972 Client . new ( SafeDeleteClient . new ( retryable_client , root_dir ) )
7073 end
7174
72- def provide_azure_cli ( options , directory_key , root_dir )
75+ def provide_storage_cli ( options , directory_key , root_dir , fork : false )
76+ client = StorageCliClient . build ( fog_connection : options . fetch ( :fog_connection ) ,
77+ directory_key : directory_key ,
78+ root_dir : root_dir ,
79+ min_size : options [ :minimum_size ] ,
80+ max_size : options [ :maximum_size ] ,
81+ fork : fork )
7382
74- client = AzureCliClient . new ( fog_connection : options . fetch ( :fog_connection ) ,
75- directory_key : directory_key ,
76- root_dir : root_dir ,
77- min_size : options [ :minimum_size ] ,
78- max_size : options [ :maximum_size ] ,
79- )
80-
81- logger = Steno . logger ( 'cc.blobstore.azure_cli' )
83+ logger = Steno . logger ( 'cc.blobstore.storage_cli_client' )
8284 errors = [ StandardError ]
83- retryable_client = RetryableClient . new ( client : client , errors : errors , logger : logger )
85+ retryable_client = RetryableClient . new ( client :, errors :, logger :)
8486
8587 Client . new ( SafeDeleteClient . new ( retryable_client , root_dir ) )
8688 end
0 commit comments