From 3797fb0c58c6205d5f4525064b410efb153dddfc Mon Sep 17 00:00:00 2001 From: shirim Date: Wed, 17 Jan 2024 14:48:27 +0200 Subject: [PATCH] CR --- pkg/vpcmodel/nodesExplainability.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pkg/vpcmodel/nodesExplainability.go b/pkg/vpcmodel/nodesExplainability.go index 9710bb48c..e20023880 100644 --- a/pkg/vpcmodel/nodesExplainability.go +++ b/pkg/vpcmodel/nodesExplainability.go @@ -175,15 +175,13 @@ func (c *VPCConfig) computeRouterAndActualRules(potentialRules *rulesAndConnDeta } potential.router = routingResource potential.filtersExternal = filtersForExternal - actual := &rulesSingleSrcDst{potential.src, potential.dst, potential.conn, routingResource, filtersForExternal, nil} - if potential.src.IsInternal() && potential.dst.IsInternal() { // internal: no need for routingResource, copy as is - actual.rules = potential.rules - } else { // connection to/from external address; adds only relevant filters + actual := *potential + if !potential.src.IsInternal() || !potential.dst.IsInternal() { actualIngress := computeActualRules(&potential.rules.ingressRules, filtersForExternal) actualEgress := computeActualRules(&potential.rules.egressRules, filtersForExternal) actual.rules = &rulesConnection{*actualIngress, *actualEgress} } - actualRulesAndConn[i] = actual + actualRulesAndConn[i] = &actual } return &actualRulesAndConn }