From 06d4479bd44c8fd1eb0df43e8491f9280e931a54 Mon Sep 17 00:00:00 2001 From: Katharina Przybill <30441792+kathap@users.noreply.github.com> Date: Thu, 18 Jan 2024 10:36:07 +0100 Subject: [PATCH] prevent double negatives --- config/cloud_controller.yml | 2 +- lib/cloud_controller/config_schemas/base/api_schema.rb | 2 +- lib/cloud_controller/config_schemas/base/clock_schema.rb | 2 +- .../config_schemas/base/deployment_updater_schema.rb | 2 +- lib/cloud_controller/dependency_locator.rb | 2 +- spec/fixtures/config/port_8181_config.yml | 2 +- spec/unit/lib/cloud_controller/dependency_locator_spec.rb | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/config/cloud_controller.yml b/config/cloud_controller.yml index 11ddf1b838d..fffcf6b1601 100644 --- a/config/cloud_controller.yml +++ b/config/cloud_controller.yml @@ -354,7 +354,7 @@ staging: statsd_host: "127.0.0.1" statsd_port: 8125 -disable_statsd_metrics: false +enable_statsd_metrics: true perform_blob_cleanup: false diff --git a/lib/cloud_controller/config_schemas/base/api_schema.rb b/lib/cloud_controller/config_schemas/base/api_schema.rb index a8bcf59069a..79c61ab0f92 100644 --- a/lib/cloud_controller/config_schemas/base/api_schema.rb +++ b/lib/cloud_controller/config_schemas/base/api_schema.rb @@ -322,7 +322,7 @@ class ApiSchema < VCAP::Config statsd_host: String, statsd_port: Integer, - optional(:disable_statsd_metrics) => bool, + optional(:enable_statsd_metrics) => bool, system_hostnames: [String], default_app_ssh_access: bool, diff --git a/lib/cloud_controller/config_schemas/base/clock_schema.rb b/lib/cloud_controller/config_schemas/base/clock_schema.rb index 8c6f4d5ec82..4d07467018e 100644 --- a/lib/cloud_controller/config_schemas/base/clock_schema.rb +++ b/lib/cloud_controller/config_schemas/base/clock_schema.rb @@ -177,7 +177,7 @@ class ClockSchema < VCAP::Config statsd_host: String, statsd_port: Integer, - optional(:disable_statsd_metrics) => bool, + optional(:enable_statsd_metrics) => bool, max_labels_per_resource: Integer, max_annotations_per_resource: Integer, diff --git a/lib/cloud_controller/config_schemas/base/deployment_updater_schema.rb b/lib/cloud_controller/config_schemas/base/deployment_updater_schema.rb index da1cac6b761..439a94ffa91 100644 --- a/lib/cloud_controller/config_schemas/base/deployment_updater_schema.rb +++ b/lib/cloud_controller/config_schemas/base/deployment_updater_schema.rb @@ -130,7 +130,7 @@ class DeploymentUpdaterSchema < VCAP::Config statsd_host: String, statsd_port: Integer, - optional(:disable_statsd_metrics) => bool, + optional(:enable_statsd_metrics) => bool, max_labels_per_resource: Integer, max_annotations_per_resource: Integer, diff --git a/lib/cloud_controller/dependency_locator.rb b/lib/cloud_controller/dependency_locator.rb index c20ed48458d..e21482fd0f5 100644 --- a/lib/cloud_controller/dependency_locator.rb +++ b/lib/cloud_controller/dependency_locator.rb @@ -351,7 +351,7 @@ def statsd_client @dependencies[:statsd_client] else config = CloudController::DependencyLocator.instance.config - if config.get(:disable_statsd_metrics) == false + if config.get(:enable_statsd_metrics) == true Statsd.logger = Steno.logger('statsd.client') register(:statsd_client, Statsd.new(config.get(:statsd_host), config.get(:statsd_port))) else diff --git a/spec/fixtures/config/port_8181_config.yml b/spec/fixtures/config/port_8181_config.yml index eade372e5ee..c7df2e89845 100644 --- a/spec/fixtures/config/port_8181_config.yml +++ b/spec/fixtures/config/port_8181_config.yml @@ -206,7 +206,7 @@ droplets: statsd_host: "127.0.0.1" statsd_port: 8125 -disable_statsd_metrics: false +enable_statsd_metrics: true perform_blob_cleanup: false diff --git a/spec/unit/lib/cloud_controller/dependency_locator_spec.rb b/spec/unit/lib/cloud_controller/dependency_locator_spec.rb index 94172abfd78..08d0186be1f 100644 --- a/spec/unit/lib/cloud_controller/dependency_locator_spec.rb +++ b/spec/unit/lib/cloud_controller/dependency_locator_spec.rb @@ -492,7 +492,7 @@ TestConfig.override( statsd_host: host, statsd_port: port, - disable_statsd_metrics: true + enable_statsd_metrics: false ) expected_client = double(CloudController::NullStatsdClient)