Skip to content

fix(helm): honor buffer.enable in the Fluentd outputs - #2118

Open
lbarrosby wants to merge 3 commits into
fluent:masterfrom
lbarrosby:fix/helm-fluentd-buffer-enable
Open

lbarrosby wants to merge 3 commits into
fluent:masterfrom
lbarrosby:fix/helm-fluentd-buffer-enable

Conversation

@lbarrosby

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Follow-up from the review on #2114: the Fluentd Elasticsearch and OpenSearch output templates ignore buffer.enable, so the buffer block renders even with enable: false, which is the ES default in values.yaml. The Kafka output had the same pattern, so it is fixed here too.

Each template now wraps the existing with .buffer in if and .buffer .buffer.enable, so the block only renders when buffer.enable is true. Outputs without a buffer map (the OpenSearch default is {}) render as before.

The .buffer.type / .buffer.path scope bug in the OpenSearch template is fixed separately in #2115 and is not touched here. This branch merges cleanly with both #2114 and #2115.

Checked with helm template:

  • ES and Kafka with buffer.enable: false (the defaults): no buffer block (before: rendered).
  • ES and Kafka with buffer.enable: true: output identical to master.
  • OpenSearch with buffer.enable: false: no buffer block (before: failed with nil pointer evaluating interface {}.type).
  • OpenSearch with buffer.enable: true on top of fix(helm): use the buffer scope in the Fluentd OpenSearch output #2115: buffer block rendered.

helm lint passes and the rendered manifests pass kubeconform.

Which issue(s) this PR fixes:

None, follow-up from the #2114 review.

Does this PR introduced a user-facing change?

Helm chart: the Fluentd Elasticsearch, OpenSearch and Kafka outputs now honor `buffer.enable` and only render the buffer section when it is true.

Additional documentation, usage docs, etc.:

The Fluentd Elasticsearch, OpenSearch and Kafka output templates only
checked that a buffer map existed, so the buffer block was rendered even
with buffer.enable: false, which is the default for the ES and Kafka
outputs in values.yaml. Render it only when buffer.enable is true.

Signed-off-by: Lucas Barros <lucasbarros.kam@gmail.com>
The template ranges over .buffer with {{ with }}, so .buffer.type and
.buffer.path looked up a nested buffer key and failed to render as soon
as any OpenSearch buffer value was set.

Signed-off-by: Lucas Barros <lucasbarros.kam@gmail.com>
…ock"

This is already fixed in fluent#2115, keep this PR to buffer.enable only.

Signed-off-by: Lucas Barros <lucasbarros.kam@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant