envoyproxy / envoyproxy/gateway

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

未关闭
#5,656 7 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看
kind/bug stale
主要语言
Go
星标
3k
派生
864
平均合并
2 天 2 小时
30 天内合并 PR
140

描述

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

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。