Skip to content

fix(fluentd): render respondsWithEmptyImg as respond_with_empty_img - #2139

Open
lbarrosby wants to merge 1 commit into
fluent:masterfrom
lbarrosby:fix-fluentd-http-respond-with-empty-img
Open

lbarrosby wants to merge 1 commit into
fluent:masterfrom
lbarrosby:fix-fluentd-http-respond-with-empty-img

Conversation

@lbarrosby

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

httpPlugin in apis/fluentd/v1alpha1/plugins/input/types.go rendered http.respondsWithEmptyImg: true as:

<source>
  @type  http
  responds_with_empty_img  true
</source>

Fluentd's in_http declares the option as config_param :respond_with_empty_img, :bool, default: false (lib/fluent/plugin/in_http.rb). The extra s makes Fluentd log parameter 'responds_with_empty_img' in <source> is not used and keep replying with an empty body, so clients that expect the 1x1 GIF (the reason to enable the option, e.g. tracking pixels) never get it.

The rendered key is now respond_with_empty_img. The CRD field name respondsWithEmptyImg stays as it is, so existing resources keep working and now take effect.

Test: new apis/fluentd/v1alpha1/plugins/input/http_params_test.go. On master it fails with:

respond_with_empty_img = "", want "true" in "<source>\n  @id  http-input\n  @type  http\n  responds_with_empty_img  true\n</source>\n"

and passes with this change. go test ./apis/... and golangci-lint run ./apis/fluentd/... pass.

Which issue(s) this PR fixes:

None filed.

Does this PR introduced a user-facing change?

Fluentd http input: `respondsWithEmptyImg` is now rendered as `respond_with_empty_img`, so the option takes effect.

The http input wrote respondsWithEmptyImg as responds_with_empty_img.
in_http only knows respond_with_empty_img, so Fluentd warned that the
parameter was not used and kept answering with an empty body.

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