From 990140ee1cde9a579156a9cdea48d0968a5c355a Mon Sep 17 00:00:00 2001 From: Vegard Engen Date: Sat, 28 Jun 2025 23:53:51 +0200 Subject: [PATCH] Check for firewallGroup in same namespace if namespace is not defined --- internal/controller/firewallpolicy_controller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/controller/firewallpolicy_controller.go b/internal/controller/firewallpolicy_controller.go index a0b4fc9..b3565af 100644 --- a/internal/controller/firewallpolicy_controller.go +++ b/internal/controller/firewallpolicy_controller.go @@ -310,7 +310,7 @@ func (r *FirewallPolicyReconciler) Reconcile(ctx context.Context, req ctrl.Reque // Run through all firewall groups. Add them to the myFirewallGroups list if they either have an annotations or is specified in the resource. for _, firewallGroup := range firewallGroupCRDs.Items { - if val, found := firewallGroup.Annotations["unifi.engen.priv.no/firewall-policy"]; found && ((strings.Contains(val, "/") && val == firewallPolicy.Namespace+"/"+firewallPolicy.Name) || (val == firewallPolicy.Name && firewallPolicy.Namespace == defaultNs)) { + if val, found := firewallGroup.Annotations["unifi.engen.priv.no/firewall-policy"]; found && ((strings.Contains(val, "/") && val == firewallPolicy.Namespace+"/"+firewallPolicy.Name) || (val == firewallPolicy.Name && firewallPolicy.Namespace == firewallGroup.Namespace)) { myFirewallGroups = append(myFirewallGroups, firewallGroup) } else if _, found := destination_groups[firewallGroup.Namespace+"/"+firewallGroup.Name]; found { myFirewallGroups = append(myFirewallGroups, firewallGroup)