Skip to content

Duplicate BackendRefs in HTTPRoute rules #102

@mlavacca

Description

@mlavacca

What happened:

When converting Ingresses with the same rules into Gateway API objects, HTTPRoute Matches are properly grouped, while rule BackendRefs are duplicated.

What you expected to happen:

How to reproduce it (as minimally and precisely as possible):

the conversion output of the following yaml file:

---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingressa
  namespace: migration
  annotations:
    konghq.com/strip-path: "true"
spec:
  ingressClassName: kong
  rules:
  - http:
      paths:
      - path: /mia
        pathType: Prefix
        backend:
          service:
            name: mia
            port:
              number: 80
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingressb
  namespace: migration
  annotations:
    konghq.com/strip-path: "true"
spec:
  ingressClassName: kong
  rules:
  - http:
      paths:
      - path: /mia
        pathType: Prefix
        backend:
          service:
            name: mia
            port:
              number: 80

is

apiVersion: gateway.networking.k8s.io/v1beta1
kind: Gateway
metadata:
  creationTimestamp: null
  name: kong
  namespace: migration
spec:
  gatewayClassName: kong
  listeners:
  - name: http
    port: 80
    protocol: HTTP
status: {}
---
apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
metadata:
  creationTimestamp: null
  name: ingressA-all-hosts
  namespace: migration
spec:
  parentRefs:
  - name: kong
  rules:
  - backendRefs:
    - name: mia
      port: 80
    - name: mia
      port: 80
    matches:
    - path:
        type: PathPrefix
        value: /mia
status:
  parents: []

Anything else we need to know?:

Metadata

Metadata

Assignees

Labels

good first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.kind/bugCategorizes issue or PR as related to a bug.triage/acceptedIndicates an issue or PR is ready to be actively worked on.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions