From 550e935835e640152d5e962196f5b0dbb5f018f8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 20:29:56 +0100 Subject: [PATCH] Revert PR #16050 (#16203) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The PR was created to skip resolving environment variable references in comments present in the “config.string” pipelines defined in the pipelines.yml file. However it introduced a bug that no longer resolves env var references in values of settings like pipeline.batch.size or queue.max_bytes. For now we’ll revert this PR and create a fix that handles both problems. (cherry picked from commit efa83787a565064fbf2f4327741455f8863aefe2) Co-authored-by: Andrea Selva --- .../lib/logstash/config/source/multi_local.rb | 2 +- .../config/source/multi_local_spec.rb | 21 ++++++++++--------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/logstash-core/lib/logstash/config/source/multi_local.rb b/logstash-core/lib/logstash/config/source/multi_local.rb index 2a523e85031..14697835cba 100644 --- a/logstash-core/lib/logstash/config/source/multi_local.rb +++ b/logstash-core/lib/logstash/config/source/multi_local.rb @@ -30,7 +30,7 @@ def initialize(settings) end def pipeline_configs - pipelines = retrieve_yaml_pipelines + pipelines = deep_replace(retrieve_yaml_pipelines) pipelines_settings = pipelines.map do |pipeline_settings| clone = @original_settings.clone clone.merge_pipeline_settings(pipeline_settings) diff --git a/logstash-core/spec/logstash/config/source/multi_local_spec.rb b/logstash-core/spec/logstash/config/source/multi_local_spec.rb index 2d7747da5ce..a8e9b4a3791 100644 --- a/logstash-core/spec/logstash/config/source/multi_local_spec.rb +++ b/logstash-core/spec/logstash/config/source/multi_local_spec.rb @@ -146,16 +146,17 @@ describe "#pipeline_configs" do - let(:config_string) { - "input { - udp { - port => 5555 # intentional comment contains \"${UDP_DEV_PORT}\" variable, shouldn't break functionalities - host => \"127.0.0.1\" - } - # another intentional comment contains \"${UDP_PROD_HOST}\" variable, shouldn't break functionalities - } - output {}" - } +# let(:config_string) { +# "input { +# udp { +# port => 5555 # intentional comment contains \"${UDP_DEV_PORT}\" variable, shouldn't break functionalities +# host => \"127.0.0.1\" +# } +# # another intentional comment contains \"${UDP_PROD_HOST}\" variable, shouldn't break functionalities +# } +# output {}" +# } + let(:config_string) { "input {} output {}" } let(:retrieved_pipelines) do [ { "pipeline.id" => "main", "config.string" => config_string },