-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
enhancement(config): Allow wildcards anywhere in identifiers #7873
Conversation
#6170 had added support for wildcards in identifiers in vector configs, but only as the last character. This PR expands support to allow glob matching in the same way that `vector tap` does which allows for `*` to appear anywhere in the input name. Closes #6786 Signed-off-by: Jesse Szwedko <jesse@szwedko.me>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good except for a question on the handling of broken globs.
src/config/compiler.rs
Outdated
Err(error) => { | ||
error!(message = "Invalid glob pattern for input.", component_name = name, %error); | ||
continue; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this error, or just do an exact match?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, that's true, maybe an exact match would be acceptable. Although the user may be confused if they were trying to use a pattern that ended up being invalid.
Maybe we could emit a warning and then do an exact match?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds best, yes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 updated in 5344183
Signed-off-by: Jesse Szwedko <jesse@szwedko.me>
Signed-off-by: Jesse Szwedko <jesse@szwedko.me>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good, though it appears the pattern matching change has broken a couple of the topology tests.
Signed-off-by: Jesse Szwedko <jesse@szwedko.me>
#6170 had added support for
wildcards in identifiers in vector configs, but only as the last
character. This PR expands support to allow glob matching in the same
way that
vector tap
does which allows for*
to appear anywhere inthe input name.
Closes #6786
Signed-off-by: Jesse Szwedko jesse@szwedko.me