Skip to content

HTTPRoute status updater does not remove non-targeted Gateway #6933

@muwaqar

Description

@muwaqar

Description:

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

If the HTTPRoute targeted a Gateway resource (spec.parentRefs) but then it does not target it anymore, the status.parents still has reference to the non-targeted Gateway in it.

In the example below, the gateway-notfound is not in the spec.parentRefs anymore, but is still present in the status.parents.

apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  ...
spec:
  parentRefs:
  - group: gateway.networking.k8s.io
    kind: Gateway
    name: gateway-1
    namespace: envoy-gateway-ns
    sectionName: https
  ...
status:
  parents:
  - conditions:
    ...
    parentRef:
      group: gateway.networking.k8s.io
      kind: Gateway
      name: gateway-notfound
      namespace: envoy-gateway-ns
      sectionName: https
  - conditions:
    ...
    parentRef:
      group: gateway.networking.k8s.io
      kind: Gateway
      name: gateway-1
      namespace: envoy-gateway-ns
      sectionName: https

Found it through the EG dashboards, where Targeted Parents show 8 but the Attached Parents is a higher number (9)

Image

Repro steps:

Include sample requests, environment, etc. All data and inputs
required to reproduce the bug.

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

Environment:

Include the environment like gateway version, envoy version and so on.

Logs:

Include the access logs and the Envoy logs.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions