Compare commits
6 Commits
feature/ad
...
feature/pr
| Author | SHA1 | Date | |
|---|---|---|---|
| 3a63034e26 | |||
| 2e95d29373 | |||
| 990140ee1c | |||
| 24c88264c9 | |||
| 938d53fa8f | |||
| 768c61020e |
@@ -285,7 +285,7 @@ func (r *FirewallPolicyReconciler) Reconcile(ctx context.Context, req ctrl.Reque
|
||||
// This will be used when running through all firewall groups and servics known, to see if a rule should be added.
|
||||
|
||||
for _, dest_group := range firewallPolicy.Spec.Destination.FirewallGroups {
|
||||
namespace := defaultNs
|
||||
namespace := firewallPolicy.Namespace
|
||||
if len(dest_group.Namespace) > 0 {
|
||||
namespace = dest_group.Namespace
|
||||
}
|
||||
@@ -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)
|
||||
@@ -340,7 +340,7 @@ func (r *FirewallPolicyReconciler) Reconcile(ctx context.Context, req ctrl.Reque
|
||||
skipService = true
|
||||
}
|
||||
}
|
||||
if val, found := service.Annotations["unifi.engen.priv.no/firewall-policy"]; found && ((strings.Contains(val, "/") && val == firewallPolicy.Namespace+"/"+firewallPolicy.Name) || (val == firewallPolicy.Name && firewallPolicy.Namespace == defaultNs)) && !skipService {
|
||||
if val, found := service.Annotations["unifi.engen.priv.no/firewall-policy"]; found && ((strings.Contains(val, "/") && val == firewallPolicy.Namespace+"/"+firewallPolicy.Name) || (val == firewallPolicy.Name && firewallPolicy.Namespace == service.Namespace)) && !skipService {
|
||||
myServices = append(myServices, service)
|
||||
} else if _, found := destination_services[service.Namespace+"/"+service.Name]; found && !skipService {
|
||||
myServices = append(myServices, service)
|
||||
|
||||
Reference in New Issue
Block a user