Merge pull request 'Check for firewallGroup in same namespace if namespace is not defined' (#31) from feature/default-namespace-same-as-firewallpolicy-namespace-when-referring-firewallgroup into main
All checks were successful
Publish / build (push) Successful in 2m16s
All checks were successful
Publish / build (push) Successful in 2m16s
Reviewed-on: #31
This commit is contained in:
@@ -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.
|
// 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 {
|
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)
|
myFirewallGroups = append(myFirewallGroups, firewallGroup)
|
||||||
} else if _, found := destination_groups[firewallGroup.Namespace+"/"+firewallGroup.Name]; found {
|
} else if _, found := destination_groups[firewallGroup.Namespace+"/"+firewallGroup.Name]; found {
|
||||||
myFirewallGroups = append(myFirewallGroups, firewallGroup)
|
myFirewallGroups = append(myFirewallGroups, firewallGroup)
|
||||||
|
|||||||
Reference in New Issue
Block a user