Description:
Following the reproduction steps, it is seen that the Gateway is left with a stale listener condition, for a listener
that no longer exists.
Repro steps:
- apply
examples/kubernetes/quickstart.yaml - ensure that Gateway has proper Status conditions, with 1 listener condition
showing attachedRoutes: 1.
- Add another listener in the gateway, for the listener spec to look something like this
listeners:
- allowedRoutes:
namespaces:
from: Same
name: http
port: 8080
protocol: HTTP
- allowedRoutes:
namespaces:
from: Same
name: http2
port: 8081
protocol: HTTP
This should create 2 listener conditions, both specifying attachedRoutes: 1.
3. Remove the single HTTPRoute that was created by the quickstart.yaml. Both existing listener conditions are updated correctly, specifying attachedRoutes: 0.
4. Re-apply the quickstart.yaml which will "recreate" the HTTPRoute, and "update" the Gateway to have only one listener.
5. The bug is that - in the Gateway status still shows the stale listener Condition corresponding to listener http2 with attachedRoutes: 0
The spec and status thus looks like this
spec:
gatewayClassName: eg
listeners:
- allowedRoutes:
namespaces:
from: Same
name: http
port: 8080
protocol: HTTP
status:
....
conditions:
....
listeners:
- attachedRoutes: 1
conditions:
- lastTransitionTime: "2022-12-03T06:58:58Z"
message: Listener is ready
observedGeneration: 3
reason: Ready
status: "True"
type: Ready
name: http
supportedKinds:
- group: gateway.networking.k8s.io
kind: HTTPRoute
- attachedRoutes: 0
conditions:
- lastTransitionTime: "2022-12-03T06:58:48Z"
message: Listener is ready
observedGeneration: 2
reason: Ready
status: "True"
type: Ready
name: http2
supportedKinds:
- group: gateway.networking.k8s.io
kind: HTTPRoute
Description:
Following the reproduction steps, it is seen that the Gateway is left with a stale listener condition, for a listener
that no longer exists.
Repro steps:
examples/kubernetes/quickstart.yaml- ensure that Gateway has proper Status conditions, with 1 listener conditionshowing
attachedRoutes: 1.This should create 2 listener conditions, both specifying
attachedRoutes: 1.3. Remove the single HTTPRoute that was created by the
quickstart.yaml. Both existing listener conditions are updated correctly, specifyingattachedRoutes: 0.4. Re-apply the
quickstart.yamlwhich will "recreate" the HTTPRoute, and "update" the Gateway to have only one listener.5. The bug is that - in the Gateway status still shows the stale listener Condition corresponding to listener
http2withattachedRoutes: 0The spec and status thus looks like this