Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>
  • Loading branch information
zhaohuabing committed Nov 23, 2024
1 parent 7a4c51e commit d948846
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions internal/provider/kubernetes/predicates.go
Original file line number Diff line number Diff line change
Expand Up @@ -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), &gtw.Status)
return false
}
Expand Down Expand Up @@ -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), &gtw.Status)
return false
}
Expand Down Expand Up @@ -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)
}

Expand Down

0 comments on commit d948846

Please sign in to comment.