envoyproxy / envoyproxy/gateway

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

Offen
#5,656 7 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
kind/bug stale
Vorherrschende Sprache
Go
Sterne
3k
Forks
864
Ø Merge
2 T. 2 Std.
Gemergte PRs (30 T.)
140

Beschreibung

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

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.