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(config): disallow non-unique component names #6270

Merged
merged 3 commits into from
Jan 29, 2021
Merged

Conversation

lukesteensen
Copy link
Member

Closes #6268

Closes #6268

Signed-off-by: Luke Steensen <luke.steensen@gmail.com>
@lukesteensen lukesteensen requested review from a team and bruceg and removed request for a team January 27, 2021 22:14
@lukesteensen
Copy link
Member Author

test sources::host_metrics::tests::filters_disk_metrics_on_device ... FAILED
test config::watcher::tests::file_update ... FAILED

Neither of these seems to be related to the change.

Comment on lines 15 to 16
// Check for non-unique names across sources, sinks, and transforms
let mut name_counts = HashMap::<&str, usize>::new();
Copy link
Member

Choose a reason for hiding this comment

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

Would it be worth trying to tell the user which kind of component was colliding? Then we'd collect into a HashMap::<&str, Vec<ComponentKind>>.

Signed-off-by: Luke Steensen <luke.steensen@gmail.com>
@lukesteensen lukesteensen requested a review from a team January 29, 2021 03:12
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 but for a bit of bikeshedding around extra cloning.

src/config/validation.rs Outdated Show resolved Hide resolved
Signed-off-by: Luke Steensen <luke.steensen@gmail.com>
@lukesteensen lukesteensen merged commit 36b36a5 into master Jan 29, 2021
@lukesteensen lukesteensen deleted the dup-names branch January 29, 2021 18:36
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.

Panic when source and transform have the same name
2 participants