envoyproxy / envoyproxy/gateway

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

Aperta
#5,656 7 commenti 2 reazioni 0 assegnatari Vedi su GitHub
kind/bug stale
Lingua principale
Go
Stelle
3k
Fork
864
Merge medio
2g 2h
PR unite (30g)
140

Descrizione

*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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.