[management] fix duplication detection (#3286)

This commit is contained in:
Pascal Fischer 2025-02-05 21:42:09 +01:00 committed by GitHub
parent 9930913e4e
commit a789e9e6d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,6 +3,7 @@ package types
import ( import (
"context" "context"
"fmt" "fmt"
"reflect"
"strconv" "strconv"
"strings" "strings"
@ -40,11 +41,7 @@ type FirewallRule struct {
// Equal checks if two firewall rules are equal. // Equal checks if two firewall rules are equal.
func (r *FirewallRule) Equal(other *FirewallRule) bool { func (r *FirewallRule) Equal(other *FirewallRule) bool {
return r.PeerIP == other.PeerIP && return reflect.DeepEqual(r, other)
r.Direction == other.Direction &&
r.Action == other.Action &&
r.Protocol == other.Protocol &&
r.Port == other.Port
} }
// generateRouteFirewallRules generates a list of firewall rules for a given route. // generateRouteFirewallRules generates a list of firewall rules for a given route.