Skip to content

Commit e486441

Browse files
committed
Add WebDAV support to storage-cli client and improve test quality
Enable WebDAV/DAV provider support in StorageCliClient by adding 'dav' to STORAGE_CLI_TYPES and mapping legacy 'webdav' provider name to 'dav'. Test improvements: - Add comprehensive tests for all legacy provider mappings (AzureRM, AWS, Google, aliyun, webdav) - Add test for native 'dav' storage-cli type - Use begin/ensure blocks to prevent tempfile leaks on test failures - Add helper methods (write_config_file, stub_config_for_droplets) to reduce repetition - Stub additional_flags in #run_cli tests for stability - Fix test descriptions for accuracy
1 parent 1306e1c commit e486441

2 files changed

Lines changed: 230 additions & 179 deletions

File tree

lib/cloud_controller/blobstore/storage_cli/storage_cli_client.rb

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ class StorageCliClient < BaseClient
1717
'resource_pool' => :storage_cli_config_file_resource_pool
1818
}.freeze
1919

20-
# Native storage-cli type names supported by CC (dav intentionally excluded for now)
21-
STORAGE_CLI_TYPES = %w[azurebs alioss s3 gcs].freeze
20+
# Native storage-cli type names supported by CC
21+
STORAGE_CLI_TYPES = %w[azurebs alioss s3 gcs dav].freeze
2222

2323
# DEPRECATED: Legacy fog provider names (remove after migration window)
2424
LEGACY_PROVIDER_TO_STORAGE_CLI_TYPE = {
2525
'AzureRM' => 'azurebs',
2626
'aliyun' => 'alioss',
2727
'AWS' => 's3',
28-
'Google' => 'gcs'
29-
# 'webdav' => 'dav', # intentionally not enabled yet
28+
'Google' => 'gcs',
29+
'webdav' => 'dav'
3030
}.freeze
3131

3232
def initialize(directory_key:, resource_type:, root_dir:, min_size: nil, max_size: nil)
@@ -39,10 +39,6 @@ def initialize(directory_key:, resource_type:, root_dir:, min_size: nil, max_siz
3939
provider = cfg['provider']&.to_s
4040
raise BlobstoreError.new("No provider specified in config file: #{File.basename(config_file_path)}") if provider.nil? || provider.empty?
4141

42-
# Explicitly block unfinished webdav storage-cli support to avoid confusion and wasted effort on debugging
43-
# unsupported providers. Remove this check when webdav support is added.
44-
raise "provider '#{provider}' is not supported yet" if %w[webdav dav].include?(provider)
45-
4642
@storage_type =
4743
if STORAGE_CLI_TYPES.include?(provider)
4844
provider

0 commit comments

Comments
 (0)