envoyproxy / envoyproxy/gateway

httproute status.parents is not cleaned up when httproute no longer references gateway in spec.parentRefs (breaks external-dns)

Abierto
#5,656 7 comentarios 2 reacciones 0 asignados Ver en GitHub
kind/bug stale
Lenguaje dominante
Go
Estrellas
3k
Forks
864
Merge medio
2 d 2 h
PR fusionados (30 d)
140

Descripción

*Description*:
>What issue is being seen? Describe what should be happening instead of
the bug, for example: The expected value isn't returned, etc.

The `status.parents` attribute retains an entry for a no longer connected parent. With the example below the end result is I am getting an A record with 2 IPs (my public IP and my private IP when the route is only attached to a single gateway (the public) in my case).

- https://github.com/kubernetes-sigs/external-dns/blob/107595b062d226f926ac66ffd88ba4aa496eac5f/source/gateway.go#L298-L373

*Repro steps*:
> Include sample requests, environment, etc. All data and inputs
required to reproduce the bug.

- Create a route with a gateway in `parentRefs`
- Change the ref to a new/different gateway

```
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: partner-portal
namespace: whoami
spec:
hostnames:
- redacted
parentRefs:
- group: gateway.networking.k8s.io
kind: Gateway
name: envoy-gateway-public
namespace: envoy-gateway-system
rules:
- backendRefs:
- group: ""
kind: Service
name: partner-portal
port: 443
weight: 1
matches:
- path:
type: PathPrefix
value: /
status:
parents:
- conditions:
- lastTransitionTime: "2025-04-03T03:16:24Z"
message: Route is accepted
observedGeneration: 2
reason: Accepted
status: "True"
type: Accepted
- lastTransitionTime: "2025-04-03T03:16:24Z"
message: Resolved all the Object references for the Route
observedGeneration: 2
reason: ResolvedRefs
status: "True"
type: ResolvedRefs
controllerName: gateway.envoyproxy.io/gatewayclass-controller
parentRef:
group: gateway.networking.k8s.io
kind: Gateway
name: envoy-gateway-public
namespace: envoy-gateway-system
- conditions:
- lastTransitionTime: "2025-02-04T21:47:49Z"
message: Route is accepted
observedGeneration: 1
reason: Accepted
status: "True"
type: Accepted
- lastTransitionTime: "2025-02-04T21:47:49Z"
message: Resolved all the Object references for the Route
observedGeneration: 1
reason: ResolvedRefs
status: "True"
type: ResolvedRefs
controllerName: gateway.envoyproxy.io/gatewayclass-controller
parentRef:
group: gateway.networking.k8s.io
kind: Gateway
name: envoy-gateway-internal
namespace: envoy-gateway-system
```

>**Note**: If there are privacy concerns, sanitize the data prior to
sharing.

*Environment*:
>Include the environment like gateway version, envoy version and so on.

`v1.3.1`

*Logs*:
>Include the access logs and the Envoy logs.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.