Skip to content
Merged
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
4 changes: 4 additions & 0 deletions lib/cloud_controller/blobstore/fog/fog_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ class FogClient < BaseClient
attr_reader :root_dir

DEFAULT_BATCH_SIZE = 1000
DEPRECATION_MESSAGE = '[DEPRECATION WARNING] The fog blobstore client is DEPRECATED and will be REMOVED. ' \
"Please migrate to blobstore_type 'storage-cli' as soon as possible. " \
'See https://github.com/cloudfoundry/community/blob/main/toc/rfc/rfc-0043-cc-blobstore-storage-cli.md for details.'.freeze

def initialize(connection_config:,
directory_key:,
Expand All @@ -30,6 +33,7 @@ def initialize(connection_config:,
@max_size = max_size
@aws_storage_options = aws_storage_options
@gcp_storage_options = gcp_storage_options
logger.warn('blobstore.fog-deprecated', message: DEPRECATION_MESSAGE)
Comment thread
johha marked this conversation as resolved.
end

def local?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module Jobs::Runtime
subject(:job) { ServiceOperationsInitialCleanup.new }

let(:fake_orphan_mitigator) { double(VCAP::Services::ServiceBrokers::V2::OrphanMitigator) }
let(:fake_logger) { instance_double(Steno::Logger, info: nil) }
let(:fake_logger) { instance_double(Steno::Logger, info: nil, warn: nil) }

it { is_expected.to be_a_valid_job }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ module Blobstore
Fog::Mock.reset
end

it 'logs a deprecation warning on initialization' do
expect_any_instance_of(Steno::Logger).to receive(:warn).with('blobstore.fog-deprecated', hash_including(:message))
FogClient.new(connection_config:, directory_key:)
end

describe 'conforms to blobstore client interface' do
let(:deletable_blob) { instance_double(FogBlob, file: nil) }

Expand Down
Loading