Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
Signed-off-by: Huabing Zhao <[email protected]>
  • Loading branch information
zhaohuabing committed Nov 23, 2024
1 parent 8c9d33e commit fc97316
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions internal/gatewayapi/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,6 @@ type StatusesToDelete struct {
func (r *Runner) getAllStatuses() *StatusesToDelete {
// Maps storing status keys to be deleted
ds := &StatusesToDelete{
GatewayStatusKeys: make(map[types.NamespacedName]bool),
HTTPRouteStatusKeys: make(map[types.NamespacedName]bool),
GRPCRouteStatusKeys: make(map[types.NamespacedName]bool),
TLSRouteStatusKeys: make(map[types.NamespacedName]bool),
Expand All @@ -387,9 +386,9 @@ func (r *Runner) getAllStatuses() *StatusesToDelete {
}

// Get current status keys
for key := range r.ProviderResources.GatewayStatuses.LoadAll() {
ds.GatewayStatusKeys[key] = true
}
// 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.
// 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 Expand Up @@ -428,10 +427,6 @@ func (r *Runner) getAllStatuses() *StatusesToDelete {
}

func (r *Runner) deleteStatusKeys(ds *StatusesToDelete) {
for key := range ds.GatewayStatusKeys {
r.ProviderResources.GatewayStatuses.Delete(key)
delete(ds.GatewayStatusKeys, key)
}
for key := range ds.HTTPRouteStatusKeys {
r.ProviderResources.HTTPRouteStatuses.Delete(key)
delete(ds.HTTPRouteStatusKeys, key)
Expand Down

0 comments on commit fc97316

Please sign in to comment.