kgateway version
v2.0.0-dev (main branch)
Kubernetes Version
v1.30.0 (or any supported k8s version)
Describe the bug
kgateway does not clean up stale status reports for orphaned/detached GRPCRoute, TCPRoute, and TLSRoute resources when their ParentRefs are removed or when they become orphaned.
Additionally, the Status field is completely dropped during the conversion of TLSRoute across different API versions (e.g. v1/v1alpha3 -> internal v1alpha2), which prevents the translator from recognizing existing status entries for TLSRoutes.
Expected Behavior
When a GRPCRoute, TCPRoute, or TLSRoute is detached or orphaned, its stale status reports should be successfully cleared from the resource (matching the existing behavior for HTTPRoute).
During version conversion of TLSRoute (e.g., in pkg/pluginsdk/collections/tlsroute_version.go), the Status field should be fully preserved.
Steps to reproduce the bug
- Deploy a Gateway and a GRPCRoute (or TCPRoute/TLSRoute) attached to it.
- Verify that the route's status shows accepted/programmed for the Gateway parent.
- Delete the Gateway or remove the parentRefs from the route spec.
- Inspect the route status (e.g. kubectl get GRPCRoute -o yaml).
- Notice that the old parent status entry under status.parents is still present and stale (has not been cleared).
Helm Values
Default helm values used.
Kgateway pod logs
N/A (Logic/design bug in status reporting).
Proxy pod logs
N/A
Additional Environment Detail
N/A
Additional Context
The bug resides in:
pkg/kgateway/proxy_syncer/proxy_syncer.go:
go
// Only HTTP routes had status markers processed:
objStatus := krt.Fetch(kctx, s.commonCols.Routes.GetHTTPRouteStatusMarkers())
s.commonCols.Routes.ProcessHTTPRouteStatusMarkers(objStatus, merged)
pkg/pluginsdk/collections/tlsroute_version.go: convertTLSRouteV1ToV1Alpha2 and convertTLSRouteV1Alpha3ToV1Alpha2 did not copy the Status field from input to output.
pkg/pluginsdk/collections/tlsroute_version.go: convertTLSRouteV1ToV1Alpha2 and convertTLSRouteV1Alpha3ToV1Alpha2 did not copy the Status field from input to output.
kgateway version
v2.0.0-dev (main branch)
Kubernetes Version
v1.30.0 (or any supported k8s version)
Describe the bug
kgateway does not clean up stale status reports for orphaned/detached GRPCRoute, TCPRoute, and TLSRoute resources when their ParentRefs are removed or when they become orphaned.
Additionally, the Status field is completely dropped during the conversion of TLSRoute across different API versions (e.g. v1/v1alpha3 -> internal v1alpha2), which prevents the translator from recognizing existing status entries for TLSRoutes.
Expected Behavior
When a GRPCRoute, TCPRoute, or TLSRoute is detached or orphaned, its stale status reports should be successfully cleared from the resource (matching the existing behavior for HTTPRoute).
During version conversion of TLSRoute (e.g., in pkg/pluginsdk/collections/tlsroute_version.go), the Status field should be fully preserved.
Steps to reproduce the bug
Helm Values
Default helm values used.
Kgateway pod logs
N/A (Logic/design bug in status reporting).
Proxy pod logs
N/A
Additional Environment Detail
N/A
Additional Context
The bug resides in:
pkg/kgateway/proxy_syncer/proxy_syncer.go:
go
// Only HTTP routes had status markers processed:
objStatus := krt.Fetch(kctx, s.commonCols.Routes.GetHTTPRouteStatusMarkers())
s.commonCols.Routes.ProcessHTTPRouteStatusMarkers(objStatus, merged)
pkg/pluginsdk/collections/tlsroute_version.go: convertTLSRouteV1ToV1Alpha2 and convertTLSRouteV1Alpha3ToV1Alpha2 did not copy the Status field from input to output.
pkg/pluginsdk/collections/tlsroute_version.go: convertTLSRouteV1ToV1Alpha2 and convertTLSRouteV1Alpha3ToV1Alpha2 did not copy the Status field from input to output.