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

Fix nrpes var init #94

Merged
merged 1 commit into from
Nov 8, 2023
Merged

Fix nrpes var init #94

merged 1 commit into from
Nov 8, 2023

Conversation

sed-i
Copy link
Contributor

@sed-i sed-i commented Nov 8, 2023

Issue

When _on_nrpe_targets_changed is called with no event arg (event=None), the nrpes variable cannot be init'ed from it.

Solution

  • Initialize the nrpes variable from stored state. If the event arg is None, then at this point the stored state value is already up to date.
  • Add relevant tests

Fixes #92.

Copy link

@PietroPasotti PietroPasotti left a comment

Choose a reason for hiding this comment

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

please add a test for this path though, so we don't have the same issue again :/

@sed-i
Copy link
Contributor Author

sed-i commented Nov 8, 2023

Will merge and test manually with @przemeklal. Tests will be added after #93.
Captured in #95.

@sed-i sed-i merged commit de6fab3 into main Nov 8, 2023
12 checks passed
@sed-i sed-i deleted the feature/fix-none branch November 8, 2023 09:14
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.

Regression: downstream-prometheus-scrape-relation-joined fails
4 participants