Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
74 changes: 0 additions & 74 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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.5)
msgpack (~> 1.2)
builder (3.3.0)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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.1)
multi_json (1.21.1)
multipart-parser (0.1.1)
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion lib/cloud_controller/blobstore/fog/providers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
require 'fog/aws'
require 'fog/local'
require 'fog/google'
require 'fog/azurerm'
require 'fog/openstack'

Fog::Logger[:deprecation] = original
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 0 additions & 27 deletions spec/unit/lib/cloud_controller/blobstore/fog/fog_client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -461,33 +461,6 @@ def upload_tmpfile(client, key='abcdef')
end
end
end

context 'AzureRM' do
let(:az_connection_config) do
{
provider: 'AzureRM',
Comment thread
WeiQuan0605 marked this conversation as resolved.
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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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)
Expand All @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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,
Expand Down
Loading