Skip to content

Commit

Permalink
Revert PR #16050 (#16203)
Browse files Browse the repository at this point in the history
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 efa8378)

Co-authored-by: Andrea Selva <[email protected]>
  • Loading branch information
github-actions[bot] and andsel authored Jun 6, 2024
1 parent 7afb42c commit 550e935
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion logstash-core/lib/logstash/config/source/multi_local.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
21 changes: 11 additions & 10 deletions logstash-core/spec/logstash/config/source/multi_local_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down

0 comments on commit 550e935

Please sign in to comment.