Skip to content

Commit

Permalink
add comment
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 fc97316 commit 8323c0f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/gatewayapi/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,8 @@ func (r *Runner) getAllStatuses() *StatusesToDelete {
}

// Get current status keys
// Do not delete the status keys for the Gateway because the Gateway status is also stored in the provider runner
// to update the address and workload status.
// Do not delete the status keys for the Gateway because the Gateway status has also been stored into the ProviderResources
// by the kubernetes provider to update the address and workload status.
// TODO: zhaohuabing move all the status handling to Gateway API translator to avoid this.
for key := range r.ProviderResources.HTTPRouteStatuses.LoadAll() {
ds.HTTPRouteStatusKeys[key] = true
Expand Down
6 changes: 6 additions & 0 deletions internal/provider/kubernetes/predicates.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,9 @@ func (r *gatewayAPIReconciler) validateServiceForReconcile(obj client.Object) bo
// Check if the Service belongs to a Gateway, if so, update the Gateway status.
gtw := r.findOwningGateway(ctx, labels)
if gtw != nil {
// 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.
r.resources.GatewayStatuses.Store(utils.NamespacedName(gtw), &gtw.Status)
return false
}
Expand Down Expand Up @@ -528,6 +531,9 @@ func (r *gatewayAPIReconciler) validateObjectForReconcile(obj client.Object) boo
// Check if the obj belongs to a Gateway, if so, update the Gateway status.
gtw := r.findOwningGateway(ctx, labels)
if gtw != nil {
// 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.
r.resources.GatewayStatuses.Store(utils.NamespacedName(gtw), &gtw.Status)
return false
}
Expand Down

0 comments on commit 8323c0f

Please sign in to comment.