envoyproxy / envoyproxy/gateway

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

Open
#5,656 7 comments 2 reactions 0 assignees View on GitHub
kind/bug stale
Dominant language
Go
Stars
3k
Forks
864
Avg merge
2d 2h
Merged PRs (30d)
140

Description

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.