Compare commits
10 Commits
v0.1.1-bet
...
v0.1.1-bet
| Author | SHA1 | Date | |
|---|---|---|---|
| 32a595d160 | |||
| 834f52c015 | |||
| 9d43b517e6 | |||
| 2b38f08a1a | |||
| 3a63034e26 | |||
| 37d8060995 | |||
| 8623d6cbc0 | |||
| 61606e8a7e | |||
| 44d89a5a50 | |||
| 19f24add0a |
@@ -377,7 +377,7 @@ func (r *FirewallGroupReconciler) Reconcile(ctx context.Context, req reconcile.R
|
||||
if err != nil {
|
||||
msg := strings.ToLower(err.Error())
|
||||
log.Info(msg)
|
||||
if strings.Contains(msg, "api.err.objectreferredby") || strings.Contains(msg,"invalid character") {
|
||||
if strings.Contains(msg, "api.err.objectreferredby") || strings.Contains(msg, "invalid character") {
|
||||
log.Info("Firewall group is in use. Invoking workaround...!")
|
||||
firewall_group.GroupMembers = []string{"127.0.0.1"}
|
||||
firewall_group.Name = firewall_group.Name + "-deleted"
|
||||
@@ -417,7 +417,7 @@ func (r *FirewallGroupReconciler) Reconcile(ctx context.Context, req reconcile.R
|
||||
if err != nil {
|
||||
msg := strings.ToLower(err.Error())
|
||||
log.Info(msg)
|
||||
if strings.Contains(msg, "api.err.objectreferredby") || strings.Contains(msg,"invalid character") {
|
||||
if strings.Contains(msg, "api.err.objectreferredby") || strings.Contains(msg, "invalid character") {
|
||||
log.Info("Firewall group is in use. Invoking workaround...!")
|
||||
firewall_group.GroupMembers = []string{"::1"}
|
||||
firewall_group.Name = firewall_group.Name + "-deleted"
|
||||
@@ -457,7 +457,7 @@ func (r *FirewallGroupReconciler) Reconcile(ctx context.Context, req reconcile.R
|
||||
if err != nil {
|
||||
msg := strings.ToLower(err.Error())
|
||||
log.Info(msg)
|
||||
if strings.Contains(msg, "api.err.objectreferredby") || strings.Contains(msg,"invalid character") {
|
||||
if strings.Contains(msg, "api.err.objectreferredby") || strings.Contains(msg, "invalid character") {
|
||||
log.Info("Firewall group is in use. Invoking workaround...!")
|
||||
firewall_group.GroupMembers = []string{"0"}
|
||||
firewall_group.Name = firewall_group.Name + "-deleted"
|
||||
@@ -497,7 +497,7 @@ func (r *FirewallGroupReconciler) Reconcile(ctx context.Context, req reconcile.R
|
||||
if err != nil {
|
||||
msg := strings.ToLower(err.Error())
|
||||
log.Info(msg)
|
||||
if strings.Contains(msg, "api.err.objectreferredby") || strings.Contains(msg,"invalid character") {
|
||||
if strings.Contains(msg, "api.err.objectreferredby") || strings.Contains(msg, "invalid character") {
|
||||
log.Info("Firewall group is in use. Invoking workaround...!")
|
||||
firewall_group.GroupMembers = []string{"127.0.0.1"}
|
||||
firewall_group.Name = firewall_group.Name + "-deleted"
|
||||
|
||||
@@ -125,6 +125,7 @@ func (r *FirewallPolicyReconciler) Reconcile(ctx context.Context, req ctrl.Reque
|
||||
}
|
||||
log.Info("Running finalizer logic for FirewallPolicy", "name", firewallPolicy.Name)
|
||||
|
||||
if firewallPolicy.Status.ResourcesManaged != nil {
|
||||
if len(firewallPolicy.Status.ResourcesManaged.UnifiFirewallPolicies) > 0 {
|
||||
for i, UnifiFirewallPolicy := range firewallPolicy.Status.ResourcesManaged.UnifiFirewallPolicies {
|
||||
log.Info(fmt.Sprintf("From: %s to: %s TcpIpv4: %s UdpIpv4: %s TcpIpv6: %s UdpIpv6: %s", UnifiFirewallPolicy.From, UnifiFirewallPolicy.To, UnifiFirewallPolicy.TcpIpv4ID, UnifiFirewallPolicy.UdpIpv4ID, UnifiFirewallPolicy.TcpIpv6ID, UnifiFirewallPolicy.UdpIpv6ID))
|
||||
@@ -193,6 +194,7 @@ func (r *FirewallPolicyReconciler) Reconcile(ctx context.Context, req ctrl.Reque
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
controllerutil.RemoveFinalizer(&firewallPolicy, firewallPolicyFinalizer)
|
||||
if err := r.Update(ctx, &firewallPolicy); err != nil {
|
||||
return ctrl.Result{}, err
|
||||
@@ -285,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.
|
||||
|
||||
for _, dest_group := range firewallPolicy.Spec.Destination.FirewallGroups {
|
||||
namespace := defaultNs
|
||||
namespace := firewallPolicy.Namespace
|
||||
if len(dest_group.Namespace) > 0 {
|
||||
namespace = dest_group.Namespace
|
||||
}
|
||||
destination_groups[namespace+"/"+dest_group.Name] = struct{}{}
|
||||
}
|
||||
for _, dest_service := range firewallPolicy.Spec.Destination.Services {
|
||||
namespace := defaultNs
|
||||
namespace := firewallPolicy.Namespace
|
||||
if len(dest_service.Namespace) > 0 {
|
||||
namespace = dest_service.Namespace
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user