diff --git a/internal/provider/kubernetes/predicates.go b/internal/provider/kubernetes/predicates.go index 79a15a01c15..b7a87aca260 100644 --- a/internal/provider/kubernetes/predicates.go +++ b/internal/provider/kubernetes/predicates.go @@ -297,6 +297,9 @@ func (r *gatewayAPIReconciler) validateServiceForReconcile(obj client.Object) bo // Trigger a status update for the Gateway. // The status updater will check the service to get the addresses of the Gateway, // and check the Deployment/DaemonSet to get the status of the Gateway workload. + // Since the gtw.Status does not have the real changed status, we need to delete it first to avoid the status + // is equal to the previous status, and make sure the subscriber can get the update. + r.resources.GatewayStatuses.Delete(utils.NamespacedName(gtw)) r.resources.GatewayStatuses.Store(utils.NamespacedName(gtw), >w.Status) return false } @@ -534,6 +537,9 @@ func (r *gatewayAPIReconciler) validateObjectForReconcile(obj client.Object) boo // Trigger a status update for the Gateway. // The status updater will check the service to get the addresses of the Gateway, // and check the Deployment/DaemonSet to get the status of the Gateway workload. + // Since the gtw.Status does not have the real changed status, we need to delete it first to avoid the status + // is equal to the previous status, and make sure the subscriber can get the update. + r.resources.GatewayStatuses.Delete(utils.NamespacedName(gtw)) r.resources.GatewayStatuses.Store(utils.NamespacedName(gtw), >w.Status) return false } @@ -642,6 +648,9 @@ func (r *gatewayAPIReconciler) updateStatusForGatewaysUnderGatewayClass(ctx cont } for _, gateway := range gateways.Items { + // Since the gtw.Status does not have the real changed status, we need to delete it first to avoid the status + // is equal to the previous status, and make sure the subscriber can get the update. + r.resources.GatewayStatuses.Delete(utils.NamespacedName(&gateway)) r.resources.GatewayStatuses.Store(utils.NamespacedName(&gateway), &gateway.Status) }