We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c05d2cc commit a6fafe9Copy full SHA for a6fafe9
ray-operator/controllers/ray/utils/util.go
@@ -1059,8 +1059,12 @@ func IsHTTPRouteEqual(existing, desired *gwv1.HTTPRoute) bool {
1059
return existing == desired
1060
}
1061
1062
- // Compare Hostnames
1063
- if !reflect.DeepEqual(existing.Spec.Hostnames, desired.Spec.Hostnames) {
+ // Compare Hostnames. Treat nil and empty slice as equivalent to avoid false positives
+ // caused by renormalization from the API server or the Gateway implementation.
1064
+ if len(existing.Spec.Hostnames) != len(desired.Spec.Hostnames) {
1065
+ return false
1066
+ }
1067
+ if len(existing.Spec.Hostnames) > 0 && !reflect.DeepEqual(existing.Spec.Hostnames, desired.Spec.Hostnames) {
1068
return false
1069
1070
0 commit comments