Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Heartbeat] Produce error rather than panic on missing source #24404

Merged
merged 1 commit into from
Mar 16, 2021

Commits on Mar 5, 2021

  1. [Heartbeat] Produce error rather than panic on missing source

    Fixes elastic#24403.
    
    With the changes to the heartbeat config syntax in 7.12 the `source`
    field is now required. Our config validation code didn't actually check
    for this field's presence, which caused an NPE.
    
    This PR adds a validation checking for that config's presence. It also
    adds tests for the validation code for config sub-fields. There were no
    defects found in the validations for source.inline, or source.browser,
    but a few tests were missing.
    
    Instead of the panic seen in elastic#24403 users will now get the error seen
    below.
    
    ```
    2021-03-05T15:41:40.146-0600	ERROR	instance/beat.go:952	Exiting: could not create monitor: job err could not parse suite config: config 'source' must be specified for this monitor, if upgrading from a previous experimental version please see our new config docs accessing 'heartbeat.monitors.0' (source:'sample-synthetics-config/heartbeat.yml')
    Exiting: could not create monitor: job err could not parse suite config: config 'source' must be specified for this monitor, if upgrading from a previous experimental version please see our new config docs accessing 'heartbeat.monitors.0' (source:'sample-synthetics-config/heartbeat.yml')
    ```
    andrewvc committed Mar 5, 2021
    Configuration menu
    Copy the full SHA
    6e9c75c View commit details
    Browse the repository at this point in the history