Skip to content

Commit a6fafe9

Browse files
Update ray-operator/controllers/ray/utils/util.go
Co-authored-by: Jia-Wei Jiang <36886416+JiangJiaWei1103@users.noreply.github.com> Signed-off-by: Ryan O'Leary <113500783+ryanaoleary@users.noreply.github.com>
1 parent c05d2cc commit a6fafe9

File tree

1 file changed

+6
-2
lines changed
  • ray-operator/controllers/ray/utils

1 file changed

+6
-2
lines changed

ray-operator/controllers/ray/utils/util.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,8 +1059,12 @@ func IsHTTPRouteEqual(existing, desired *gwv1.HTTPRoute) bool {
10591059
return existing == desired
10601060
}
10611061

1062-
// Compare Hostnames
1063-
if !reflect.DeepEqual(existing.Spec.Hostnames, desired.Spec.Hostnames) {
1062+
// Compare Hostnames. Treat nil and empty slice as equivalent to avoid false positives
1063+
// 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) {
10641068
return false
10651069
}
10661070

0 commit comments

Comments
 (0)