Skip to content

Commit

Permalink
cloc_schema and deployment_updater_schema need the optional config be…
Browse files Browse the repository at this point in the history
…cause it is read in dependeny_locator and will error if the config parameter is not there. Defaults to false, so no effect for other than api vms.
  • Loading branch information
kathap committed Jan 16, 2024
1 parent 8f8141b commit ffab5a4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/cloud_controller/config_schemas/base/clock_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ class ClockSchema < VCAP::Config

statsd_host: String,
statsd_port: Integer,
optional(:disable_statsd_metrics) => bool,

max_labels_per_resource: Integer,
max_annotations_per_resource: Integer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ class DeploymentUpdaterSchema < VCAP::Config

statsd_host: String,
statsd_port: Integer,
optional(:disable_statsd_metrics) => bool,

max_labels_per_resource: Integer,
max_annotations_per_resource: Integer,
Expand Down
17 changes: 17 additions & 0 deletions spec/unit/lib/cloud_controller/dependency_locator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,23 @@

expect(locator.statsd_client).to eq(expected_client)
end

it 'returns the statsd client for other than api vms' do
host = 'test-host'
port = 1234
TestConfig.context = :deployment_updater
TestConfig.override(
statsd_host: host,
statsd_port: port
)

expected_client = double(Statsd)

allow(Statsd).to receive(:new).with(host, port).
and_return(expected_client)

expect(locator.statsd_client).to eq(expected_client)
end
end

describe '#bbs_stager_client' do
Expand Down

0 comments on commit ffab5a4

Please sign in to comment.