fix: don't fail immediately in resolveCollectorRefs nested loop#208
Merged
burningalchemist merged 1 commit intoburningalchemist:masterfrom Mar 23, 2023
Merged
Conversation
Owner
|
Hi @unix-way, yeah, good catch. Thanks a lot for your contribution! 👍 |
Contributor
|
Hi @unix-way ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes a bug when
resolveCollectorRefs()fails immediately in nested loopsql_exporter/config/config.go
Lines 562 to 573 in dbe888f
Which actually happens every time there is a name mismatch in the slice and the map. For example, we have 3 collector files:
And the following
sql_exporter.ymlwith collectors specified without globbingIn the inner loop, the function will compare
vertica_opsagainst all collector names in the map and return an error when it hits eithervertica_eonorvertica_platform, which is an unexpected behavior. The function should continue instead and return an error only if there are no matching collectors.