Skip to content

Conversation

@SudhanshuBawane
Copy link

closed #43

Description

  • Fix for the issue of sensu-check-log runtime error.

Changed

  • The check name was getting passed as empty now it is fixed.

Signed-off-by: SudhanshuBawane <[email protected]>
@jhenderson-pro jhenderson-pro requested a review from fguimond April 4, 2024 20:07
event.go Outdated
if len(checkNameTemplate) > 0 {
checkName, err = templates.EvalTemplate("check-name", checkNameTemplate, inputEvent)
}
if err != nil {
Copy link

Choose a reason for hiding this comment

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

I believe the error check can be moved inside the if block as the error will always be null if we don't call EvalTemplate.

expectedCheckName: "", // Template evaluation should fail
expectedError: true,
},
// ... add more test cases with different scenarios
Copy link

Choose a reason for hiding this comment

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

We probably want more test here? One I can think of is with an empty ``checkNameTemplate`.

@fguimond fguimond changed the title to_be_reviewed Empty check name template was causing an error Aug 1, 2024
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.

Whenever we run this check, it throws error: creating event

3 participants