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

Prevent misleading error message when setting CUSTOMFIELDS env var #201

Merged
merged 1 commit into from
Mar 4, 2021

Conversation

zemek
Copy link
Contributor

@zemek zemek commented Mar 3, 2021

What type of PR is this?

/kind cleanup

Any specific area of the project related to this PR?

/area config

What this PR does / why we need it:
This prevents this error from being printed out, which doesn't actually prevent CUSTOMFIELDS from being set properly via an environment variable

2021/03/03 15:36:59 [ERROR] : Error unmarshalling config : 1 error(s) decoding:

* 'Customfields' expected a map, got 'string'

This default also isn't actually needed since we already initialize an empty string map in the config struct. This makes the behavior of CUSTOMFIELDS the same as Webhook.CustomHeaders and CloudEvents.Extensions which don't set this default and don't have this issue.
Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

This prevents this error from being printed out, which doesn't actually prevent CUSTOMFIELDS from being set properly
```
2021/03/03 15:36:59 [ERROR] : Error unmarshalling config : 1 error(s) decoding:

* 'Customfields' expected a map, got 'string'
```

Signed-off-by: Joseph Zemek <[email protected]>
@poiana
Copy link

poiana commented Mar 3, 2021

Welcome @zemek! It looks like this is your first PR to falcosecurity/falcosidekick 🎉

@poiana poiana added the size/XS label Mar 3, 2021
@Issif Issif added this to the 2.22.0 milestone Mar 4, 2021
Copy link
Member

@Issif Issif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, thank you 👍

@poiana
Copy link

poiana commented Mar 4, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Issif

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana poiana added the lgtm label Mar 4, 2021
@poiana
Copy link

poiana commented Mar 4, 2021

LGTM label has been added.

Git tree hash: 93f241ad832c53d3575f9dc5f27b7249b8f98ae0

@poiana poiana added the approved label Mar 4, 2021
@poiana poiana merged commit a40b94a into falcosecurity:master Mar 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants