Compare commits

...

4 Commits

Author SHA1 Message Date
834f52c015 Handle services in same namespace if namespace is not specified
All checks were successful
Build project / build (push) Successful in 1m42s
2025-06-29 01:12:26 +02:00
9d43b517e6 Merge pull request 'Properly check for firewallGroup in same namespace' (#33) from feature/properly-handle-firewallgroups-in-same-namespace into main
All checks were successful
Publish / build (push) Successful in 2m27s
Reviewed-on: #33
2025-06-28 23:07:05 +00:00
2b38f08a1a Merge pull request 'feature/cleanly-delete-empty-resources' (#32) from feature/cleanly-delete-empty-resources into main
Some checks failed
Publish / build (push) Has been cancelled
Reviewed-on: #32
2025-06-28 22:59:42 +00:00
3a63034e26 Properly check for firewallGroup in same namespace
All checks were successful
Build project / build (push) Successful in 1m54s
Publish / build (push) Successful in 2m0s
2025-06-29 00:58:57 +02:00

View File

@@ -287,14 +287,14 @@ 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. // 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 { for _, dest_group := range firewallPolicy.Spec.Destination.FirewallGroups {
namespace := defaultNs namespace := firewallPolicy.Namespace
if len(dest_group.Namespace) > 0 { if len(dest_group.Namespace) > 0 {
namespace = dest_group.Namespace namespace = dest_group.Namespace
} }
destination_groups[namespace+"/"+dest_group.Name] = struct{}{} destination_groups[namespace+"/"+dest_group.Name] = struct{}{}
} }
for _, dest_service := range firewallPolicy.Spec.Destination.Services { for _, dest_service := range firewallPolicy.Spec.Destination.Services {
namespace := defaultNs namespace := firewallPolicy.Namespace
if len(dest_service.Namespace) > 0 { if len(dest_service.Namespace) > 0 {
namespace = dest_service.Namespace namespace = dest_service.Namespace
} }