Skip to content

Expected non-zero exit code upon failure in -agent mode #6

@andrewkroh

Description

@andrewkroh

I expected to get a non-zero exit code when a failure occurs while operating on an agent config (i.e. -agent). Without -agent I do get a non-zero exit code as expected when there is an error.

With -agent

% curl --silent https://raw.githubusercontent.com/elastic/integrations/67cbd45572b346e1570d659f50f29579860c7b36/packages/qualys_vmdr/data_stream/asset_host_detection/agent/stream/input.yml.hbs \
| celfmt -agent -o /dev/null; echo $?
2025/02/04 17:41:54 did not format program field content at line 24: failed to parse program: ERROR: <input>:22:53: undeclared reference to 'decode_xml' (in container '')
 |         (resp.Body.as(xml, try(bytes(xml).decode_xml('qualys_api_2_0'), "decode_xml_error").as(body,
 | ....................................................^
0

Without -agent

curl --silent https://raw.githubusercontent.com/elastic/integrations/67cbd45572b346e1570d659f50f29579860c7b36/packages/qualys_vmdr/data_stream/asset_host_detection/agent/stream/input.yml.hbs \
| grep -v '^{{' \
| yq .program \
| celfmt ; echo $?
2025/02/11 14:05:20 failed to format program: failed to parse program: ERROR: <input>:22:53: undeclared reference to 'decode_xml' (in container '')
 |         (resp.Body.as(xml, try(bytes(xml).decode_xml('qualys_api_2_0'), "decode_xml_error").as(body, 
 | ....................................................^
1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions