From 6f4accc20878671124be4a9a9f089dda47f6c9d1 Mon Sep 17 00:00:00 2001 From: Wei Quan Date: Thu, 21 May 2026 13:29:32 +0200 Subject: [PATCH 1/3] Remove fog azure support from ccng coding and Gemfile. --- Gemfile | 3 - Gemfile.lock | 74 ------------------- README.md | 12 +-- .../blobstore/fog/providers.rb | 1 - .../blobstore/fog/fog_client_spec.rb | 27 ------- 5 files changed, 6 insertions(+), 111 deletions(-) diff --git a/Gemfile b/Gemfile index 47c7f851917..e1eb8bfffcb 100644 --- a/Gemfile +++ b/Gemfile @@ -40,11 +40,8 @@ gem 'actionview', '~> 8.1.3' gem 'activemodel', '~> 8.1.2' gem 'railties', '~> 8.1.1' -gem 'azure-storage-blob', git: 'https://github.com/sethboyles/azure-storage-ruby.git', branch: 'x-ms-blob-content-type-fix-1.1' - gem 'fog-aliyun' gem 'fog-aws' -gem 'fog-azure-rm', git: 'https://github.com/fog/fog-azure-rm.git', branch: 'fog-arm-cf' gem 'fog-core', '~> 2.6.0' gem 'fog-google', '~> 1.29.4' gem 'fog-local' diff --git a/Gemfile.lock b/Gemfile.lock index 7dc6b12fda5..ce8930eccf4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,37 +1,3 @@ -GIT - remote: https://github.com/fog/fog-azure-rm.git - revision: 379e352cce817f8e67618062bf7095095d8f5c4c - branch: fog-arm-cf - specs: - fog-azure-rm (0.4.7) - azure-storage-blob (~> 1.1) - azure-storage-common (~> 1.1) - azure_mgmt_compute (~> 0.9.0) - azure_mgmt_dns (~> 0.9.0) - azure_mgmt_key_vault (~> 0.9.0) - azure_mgmt_network (~> 0.9.0) - azure_mgmt_resources (~> 0.9.0) - azure_mgmt_sql (~> 0.9.0) - azure_mgmt_storage (~> 0.9.0) - azure_mgmt_traffic_manager (~> 0.9.0) - fog-core (>= 1.43) - fog-json (>= 1.0.2) - mime-types (~> 3.0) - vhd (= 0.0.4) - -GIT - remote: https://github.com/sethboyles/azure-storage-ruby.git - revision: d4737cdfcef3f3c4c2463a54690b6b73c0f6f707 - branch: x-ms-blob-content-type-fix-1.1 - specs: - azure-storage-blob (1.1.0) - azure-core (~> 0.1.13) - azure-storage-common (~> 1.0) - nokogiri (~> 1.6, >= 1.6.8) - azure-storage-common (1.1.0) - azure-core (~> 0.1.13) - nokogiri (~> 1.6, >= 1.6.8) - GEM remote: https://rubygems.org/ specs: @@ -72,31 +38,10 @@ GEM nokogiri (~> 1.6) rest-client (~> 2.0) ast (2.4.3) - azure-core (0.1.15) - faraday (~> 0.9) - faraday_middleware (~> 0.10) - nokogiri (~> 1.6) - azure_mgmt_compute (0.9.0) - ms_rest_azure (~> 0.7.0) - azure_mgmt_dns (0.9.0) - ms_rest_azure (~> 0.7.0) - azure_mgmt_key_vault (0.9.0) - ms_rest_azure (~> 0.7.0) - azure_mgmt_network (0.9.0) - ms_rest_azure (~> 0.7.0) - azure_mgmt_resources (0.9.0) - ms_rest_azure (~> 0.7.0) - azure_mgmt_sql (0.9.0) - ms_rest_azure (~> 0.7.0) - azure_mgmt_storage (0.9.0) - ms_rest_azure (~> 0.7.0) - azure_mgmt_traffic_manager (0.9.0) - ms_rest_azure (~> 0.7.0) backport (1.2.0) base64 (0.3.0) benchmark (0.5.0) bigdecimal (4.1.2) - bit-struct (0.17) bootsnap (1.24.4) msgpack (~> 1.2) builder (3.3.0) @@ -141,11 +86,6 @@ GEM logger faraday (0.17.6) multipart-post (>= 1.2, < 3) - faraday-cookie_jar (0.0.8) - faraday (>= 0.8.0) - http-cookie (>= 1.0.0) - faraday_middleware (0.14.0) - faraday (>= 0.7.4, < 1.0) ffi (1.17.4) ffi (1.17.4-x86_64-darwin) ffi (1.17.4-x86_64-linux-gnu) @@ -299,15 +239,6 @@ GEM prism (~> 1.5) mock_redis (0.54.0) redis (~> 5) - ms_rest (0.6.4) - concurrent-ruby (~> 1.0) - faraday (~> 0.9) - timeliness (~> 0.3) - ms_rest_azure (0.7.0) - concurrent-ruby (~> 1.0) - faraday (~> 0.9) - faraday-cookie_jar (~> 0.0.6) - ms_rest (~> 0.6.3) msgpack (1.8.0) multi_json (1.21.1) multipart-parser (0.1.1) @@ -574,7 +505,6 @@ GEM thor (1.5.0) tilt (2.7.0) timecop (0.9.11) - timeliness (0.5.3) trailblazer-option (0.1.2) tsort (0.2.0) tzinfo (2.0.6) @@ -585,8 +515,6 @@ GEM unicode-emoji (4.2.0) uri (1.1.1) useragent (0.16.11) - vhd (0.0.4) - bit-struct vmstat (2.3.1) webmock (3.26.2) addressable (>= 2.8.0) @@ -612,7 +540,6 @@ DEPENDENCIES actionview (~> 8.1.3) activemodel (~> 8.1.2) addressable - azure-storage-blob! bootsnap byebug cf-uaa-lib (~> 4.0.9) @@ -625,7 +552,6 @@ DEPENDENCIES fluent-logger fog-aliyun fog-aws - fog-azure-rm! fog-core (~> 2.6.0) fog-google (~> 1.29.4) fog-local diff --git a/README.md b/README.md index 261aaaceb26..5c785f69d42 100644 --- a/README.md +++ b/README.md @@ -37,12 +37,12 @@ When deployed via capi-release only: #### Providers -| Provider | `blobstore_type` | Backends | Notes | -|----------|------------------|----------|-------| -| Storage CLI | `storage-cli` | S3, S3-compatible, GCS, Azure, Alibaba Cloud | | -| Fog | `fog` | AWS, Azure, GCS, Alibaba Cloud, OpenStack, Local/NFS | **Default.** Local/NFS not recommended for production | -| WebDAV | `webdav` | WebDAV servers | | -| Local | `local`, `local-temp-storage` | Filesystem, NFS | Development and testing only | +| Provider | `blobstore_type` | Backends | Notes | +|----------|------------------|-----------------------------------------------|-------| +| Storage CLI | `storage-cli` | S3, S3-compatible, GCS, Azure, Alibaba Cloud | | +| Fog | `fog` | AWS, GCS, Alibaba Cloud, OpenStack, Local/NFS | **Default.** Local/NFS not recommended for production | +| WebDAV | `webdav` | WebDAV servers | | +| Local | `local`, `local-temp-storage` | Filesystem, NFS | Development and testing only | ### Runtime diff --git a/lib/cloud_controller/blobstore/fog/providers.rb b/lib/cloud_controller/blobstore/fog/providers.rb index 5dce71d107d..439de37e2d7 100644 --- a/lib/cloud_controller/blobstore/fog/providers.rb +++ b/lib/cloud_controller/blobstore/fog/providers.rb @@ -10,7 +10,6 @@ require 'fog/aws' require 'fog/local' require 'fog/google' -require 'fog/azurerm' require 'fog/openstack' Fog::Logger[:deprecation] = original diff --git a/spec/unit/lib/cloud_controller/blobstore/fog/fog_client_spec.rb b/spec/unit/lib/cloud_controller/blobstore/fog/fog_client_spec.rb index 37139e9e555..adf481da9a9 100644 --- a/spec/unit/lib/cloud_controller/blobstore/fog/fog_client_spec.rb +++ b/spec/unit/lib/cloud_controller/blobstore/fog/fog_client_spec.rb @@ -461,33 +461,6 @@ def upload_tmpfile(client, key='abcdef') end end end - - context 'AzureRM' do - let(:az_connection_config) do - { - provider: 'AzureRM', - environment: 'env', - azure_storage_account_name: 'account', - azure_storage_access_key: 'key' - } - end - let(:client_with_encryption) do - FogClient.new(connection_config: az_connection_config, - directory_key: directory_key) - end - - it 'has empty storage options' do - path = File.join(local_dir, 'empty_file.png') - FileUtils.touch(path) - - client_with_encryption.cp_to_blobstore(path, 'abcdef123456') - - expect(files).to have_received(:create).with(key: anything, - body: anything, - content_type: anything, - public: anything) - end - end end end From ed1b6c4cdc2eadbff89214dfb7682711e1664f49 Mon Sep 17 00:00:00 2001 From: Wei Quan Date: Mon, 1 Jun 2026 14:38:19 +0200 Subject: [PATCH 2/3] Remove AzureRM fog legacy support from storage-cli client --- .../storage_cli/storage_cli_client.rb | 2 - .../blobstore/client_provider_spec.rb | 4 +- .../storage_cli/storage_cli_client_spec.rb | 41 +++---------------- 3 files changed, 8 insertions(+), 39 deletions(-) diff --git a/lib/cloud_controller/blobstore/storage_cli/storage_cli_client.rb b/lib/cloud_controller/blobstore/storage_cli/storage_cli_client.rb index e9fb97b10a2..2d6c1009de2 100644 --- a/lib/cloud_controller/blobstore/storage_cli/storage_cli_client.rb +++ b/lib/cloud_controller/blobstore/storage_cli/storage_cli_client.rb @@ -22,7 +22,6 @@ class StorageCliClient < BaseClient # DEPRECATED: Legacy fog provider names (remove after migration window) LEGACY_PROVIDER_TO_STORAGE_CLI_TYPE = { - 'AzureRM' => 'azurebs', 'aliyun' => 'alioss', 'AWS' => 's3', 'Google' => 'gcs' @@ -35,7 +34,6 @@ def initialize(directory_key:, resource_type:, root_dir:, min_size: nil, max_siz config_file_path = config_path_for(resource_type) cfg = fetch_config(resource_type) - # Get provider field (can contain either fog name or storage-cli type) provider = cfg['provider']&.to_s raise BlobstoreError.new("No provider specified in config file: #{File.basename(config_file_path)}") if provider.nil? || provider.empty? diff --git a/spec/unit/lib/cloud_controller/blobstore/client_provider_spec.rb b/spec/unit/lib/cloud_controller/blobstore/client_provider_spec.rb index bd0c1685a23..e11c7db187b 100644 --- a/spec/unit/lib/cloud_controller/blobstore/client_provider_spec.rb +++ b/spec/unit/lib/cloud_controller/blobstore/client_provider_spec.rb @@ -136,13 +136,13 @@ module Blobstore let(:config_path) { File.join(tmpdir, 'storage_cli_config_droplets.json') } before do - File.write(config_path, '{"provider": "AzureRM", + File.write(config_path, '{"provider": "azurebs", "account_name": "some-account-name", "account_key": "some-access-key", "container_name": "directory_key", "environment": "AzureCloud" }') allow(VCAP::CloudController::Config.config).to receive(:get).with(:storage_cli_config_file_droplets).and_return(config_path) - options.merge!(provider: 'AzureRM', minimum_size: 100, maximum_size: 1000) + options.merge!(provider: 'azurebs', minimum_size: 100, maximum_size: 1000) end it 'provides a storage-cli client' do diff --git a/spec/unit/lib/cloud_controller/blobstore/storage_cli/storage_cli_client_spec.rb b/spec/unit/lib/cloud_controller/blobstore/storage_cli/storage_cli_client_spec.rb index ead5a6e64f8..322b5bc4069 100644 --- a/spec/unit/lib/cloud_controller/blobstore/storage_cli/storage_cli_client_spec.rb +++ b/spec/unit/lib/cloud_controller/blobstore/storage_cli/storage_cli_client_spec.rb @@ -5,35 +5,6 @@ module CloudController module Blobstore RSpec.describe StorageCliClient do describe 'client init' do - # DEPRECATED: Legacy fog provider tests - remove after migration window - # START LEGACY FOG SUPPORT TESTS - it 'init the correct client when JSON has provider AzureRM (legacy fog name)' do - droplets_cfg = Tempfile.new(['droplets', '.json']) - droplets_cfg.write({ provider: 'AzureRM', - account_key: 'bommelkey', - account_name: 'bommel', - container_name: 'bommelcontainer', - environment: 'BommelCloud' }.to_json) - droplets_cfg.flush - - config_double = instance_double(VCAP::CloudController::Config) - allow(VCAP::CloudController::Config).to receive(:config).and_return(config_double) - allow(config_double).to receive(:get).with(:storage_cli_config_file_droplets).and_return(droplets_cfg.path) - - client = StorageCliClient.new( - directory_key: 'dummy-key', - root_dir: 'dummy-root', - resource_type: 'droplets' - ) - expect(client.instance_variable_get(:@storage_type)).to eq('azurebs') - expect(client.instance_variable_get(:@resource_type)).to eq('droplets') - expect(client.instance_variable_get(:@root_dir)).to eq('dummy-root') - expect(client.instance_variable_get(:@directory_key)).to eq('dummy-key') - - droplets_cfg.close! - end - # END LEGACY FOG SUPPORT TESTS - it 'init the correct client when JSON has provider azurebs (native storage-cli type)' do droplets_cfg = Tempfile.new(['droplets', '.json']) droplets_cfg.write({ provider: 'azurebs', @@ -168,7 +139,7 @@ module Blobstore before do [droplets_cfg, buildpacks_cfg, packages_cfg, resource_pool_cfg].each do |f| - f.write({ provider: 'AzureRM', + f.write({ provider: 'azurebs', account_key: 'bommelkey', account_name: 'bommel', container_name: 'bommelcontainer', @@ -247,8 +218,8 @@ def build_client(resource_type) it 'raises when provider is missing from config file' do File.write(packages_cfg.path, { - AzureRM_storage_access_key: 'bommelkey', - AzureRM_storage_account_name: 'bommel', + account_key: 'bommelkey', + account_name: 'bommel', container_name: 'bommelcontainer', environment: 'BommelCloud' }.to_json) @@ -266,7 +237,7 @@ def build_client(resource_type) describe 'Json operations' do let(:droplets_cfg) do f = Tempfile.new(['droplets', '.json']) - f.write({ provider: 'AzureRM', + f.write({ provider: 'azurebs', account_key: 'bommelkey', account_name: 'bommel', container_name: 'bommelcontainer', @@ -304,7 +275,7 @@ def build_client(resource_type) describe 'with valid client' do let(:client) do droplets_cfg = Tempfile.new(['droplets', '.json']) - droplets_cfg.write({ provider: 'AzureRM', + droplets_cfg.write({ provider: 'azurebs', account_key: 'bommelkey', account_name: 'bommel', container_name: 'bommelcontainer', @@ -341,7 +312,7 @@ def build_client(resource_type) describe 'client operations' do let!(:tmp_cfg) do f = Tempfile.new(['storage_cli_config', '.json']) - f.write({ provider: 'AzureRM', + f.write({ provider: 'azurebs', account_name: 'some-account-name', account_key: 'some-access-key', container_name: directory_key, From b8b4438a457889c9db2c160f6b96365ff2655516 Mon Sep 17 00:00:00 2001 From: Wei Quan Date: Mon, 1 Jun 2026 14:58:42 +0200 Subject: [PATCH 3/3] Update Gemfile.lock: remove residual azure gem dependencies --- Gemfile.lock | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 4f8a12ef1e5..dde7ce22492 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -42,7 +42,6 @@ GEM base64 (0.3.0) benchmark (0.5.0) bigdecimal (4.1.2) - bit-struct (0.17) bootsnap (1.24.5) msgpack (~> 1.2) builder (3.3.0) @@ -240,15 +239,6 @@ GEM prism (~> 1.5) mock_redis (0.54.0) redis (~> 5) - ms_rest (0.6.4) - concurrent-ruby (~> 1.0) - faraday (~> 0.9) - timeliness (~> 0.3) - ms_rest_azure (0.7.0) - concurrent-ruby (~> 1.0) - faraday (~> 0.9) - faraday-cookie_jar (~> 0.0.6) - ms_rest (~> 0.6.3) msgpack (1.8.1) multi_json (1.21.1) multipart-parser (0.1.1)