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

enhancement(config): Allow wildcards anywhere in identifiers #7873

Merged
merged 5 commits into from
Jun 16, 2021

Conversation

jszwedko
Copy link
Member

#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

#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>
@jszwedko jszwedko requested review from spencergilbert, a team, bruceg and lukesteensen and removed request for a team June 15, 2021 23:32
Copy link
Member

@bruceg bruceg left a 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.

Comment on lines 117 to 120
Err(error) => {
error!(message = "Invalid glob pattern for input.", component_name = name, %error);
continue;
}
Copy link
Member

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?

Copy link
Member Author

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?

Copy link
Member

Choose a reason for hiding this comment

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

That sounds best, yes.

Copy link
Member Author

Choose a reason for hiding this comment

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

👍 updated in 5344183

@jszwedko jszwedko changed the title enhancement(configuration): Allow wildcards anywhere in identifiers enhancement(config): Allow wildcards anywhere in identifiers Jun 16, 2021
Signed-off-by: Jesse Szwedko <jesse@szwedko.me>
@jszwedko jszwedko requested a review from bruceg June 16, 2021 17:43
Signed-off-by: Jesse Szwedko <jesse@szwedko.me>
Copy link
Member

@bruceg bruceg left a 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>
@jszwedko jszwedko enabled auto-merge (squash) June 16, 2021 20:47
Signed-off-by: Jesse Szwedko <jesse@szwedko.me>
@jszwedko jszwedko merged commit 6598809 into master Jun 16, 2021
@jszwedko jszwedko deleted the allow-wildcards-anywhere branch June 16, 2021 22:51
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.

Allow wildcard to appear anywhere in the input name
2 participants