Don't clear configuration when the fetch request fails #427
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When the configuration fetch request failed without an HTTP status code, the sidecar would treat this as a config change and clear its current configuration.
With this change, the failed request won't lead to the invalidation of the current configuration anymore.
Fixes #413
Reproducing this is a bit tricky because the behaviour can only be triggered when the request to
/api/sidecar/collectors
succeeds, but the subsequent request to/api/sidecar/configurations/render/*
fails.I used caddy as a proxy server between the sidecar and the Graylog server to selectively let the latter call fail. This is the
Caddyfile
I was using:Sidecar is run with the following two settings in
sidecar.yml
: