MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / rules_share_endpoint

Function rules_share_endpoint

crates/openshell-policy/src/merge.rs:595–605  ·  view source on GitHub ↗
(
    existing_rule: &NetworkPolicyRule,
    incoming_rule: &NetworkPolicyRule,
)

Source from the content-addressed store, hash-verified

593}
594
595fn rules_share_endpoint(
596 existing_rule: &NetworkPolicyRule,
597 incoming_rule: &NetworkPolicyRule,
598) -> bool {
599 incoming_rule.endpoints.iter().any(|incoming_endpoint| {
600 existing_rule
601 .endpoints
602 .iter()
603 .any(|existing_endpoint| endpoints_overlap(existing_endpoint, incoming_endpoint))
604 })
605}
606
607fn endpoints_overlap(left: &NetworkEndpoint, right: &NetworkEndpoint) -> bool {
608 if !left.host.eq_ignore_ascii_case(&right.host) {

Callers 1

add_ruleFunction · 0.85

Calls 1

endpoints_overlapFunction · 0.85

Tested by

no test coverage detected