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(downloader): multiservice discovery should filter boundary nodes based on target name #219

Merged
merged 3 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ pub mod target;
pub trait DataContract {
fn get_name(&self) -> String;
fn get_id(&self) -> String;
fn get_target_name(&self) -> String;
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,8 @@ impl DataContract for Sns {
fn get_id(&self) -> String {
self.root_canister_id.to_string()
}

fn get_target_name(&self) -> String {
self.name.to_string()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ impl DataContract for TargetDto {
fn get_id(&self) -> String {
self.node_id.to_string()
}

fn get_target_name(&self) -> String {
self.name.to_string()
}
}

pub fn map_to_target_dto(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl NodeIDRegexFilter {
impl TargetGroupFilter for NodeIDRegexFilter {
fn filter(&self, target_group: &dyn DataContract) -> bool {
if target_group.get_id() == self.bn_principal_placeholder.to_string() {
return self.regex.is_match(&target_group.get_name().to_string());
return self.regex.is_match(&target_group.get_target_name().to_string());
}

self.regex.is_match(&target_group.get_id())
Expand Down
Loading