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