From 491c05ae9a8e4b58eca37253c906f126f3642035 Mon Sep 17 00:00:00 2001 From: danehans Date: Fri, 7 Oct 2022 10:00:27 -0700 Subject: [PATCH] Updates Infra IR Port Naming Signed-off-by: danehans --- ...-namespace-with-allowed-httproute.out.yaml | 2 +- ...mespace-with-disallowed-httproute.out.yaml | 2 +- ...her-namespace-allowed-by-refgrant.out.yaml | 2 +- ...ener-with-valid-tls-configuration.out.yaml | 2 +- ...two-listeners-with-different-ports.in.yaml | 52 +++++++ ...wo-listeners-with-different-ports.out.yaml | 127 ++++++++++++++++++ ...ing-to-gateway-with-two-listeners.out.yaml | 2 +- .../httproute-attaching-to-gateway.out.yaml | 2 +- ...ner-on-gateway-with-two-listeners.out.yaml | 2 +- .../httproute-attaching-to-listener.out.yaml | 2 +- ...-multiple-backends-and-no-weights.out.yaml | 2 +- ...ith-multiple-backends-and-weights.out.yaml | 2 +- ...her-namespace-allowed-by-refgrant.out.yaml | 2 +- ...er-duplicate-add-multiple-filters.out.yaml | 2 +- ...with-header-filter-duplicate-adds.out.yaml | 2 +- ...duplicate-remove-multiple-filters.out.yaml | 2 +- ...h-header-filter-duplicate-removes.out.yaml | 2 +- ...header-filter-empty-header-values.out.yaml | 2 +- ...-with-header-filter-empty-headers.out.yaml | 2 +- ...ith-header-filter-invalid-headers.out.yaml | 2 +- ...ute-with-header-filter-no-headers.out.yaml | 2 +- ...th-header-filter-no-valid-headers.out.yaml | 2 +- ...tproute-with-header-filter-remove.out.yaml | 2 +- ...with-invalid-backend-ref-bad-port.out.yaml | 2 +- ...invalid-backend-ref-invalid-group.out.yaml | 2 +- ...-invalid-backend-ref-invalid-kind.out.yaml | 2 +- ...-with-invalid-backend-ref-no-port.out.yaml | 2 +- ...th-invalid-backend-ref-no-service.out.yaml | 2 +- ...lid-backendref-in-other-namespace.out.yaml | 2 +- ...to-gateway-with-wildcard-hostname.out.yaml | 2 +- ...ct-filter-full-path-replace-https.out.yaml | 2 +- ...ute-with-redirect-filter-hostname.out.yaml | 2 +- ...direct-filter-invalid-filter-type.out.yaml | 2 +- ...th-redirect-filter-invalid-scheme.out.yaml | 2 +- ...th-redirect-filter-invalid-status.out.yaml | 2 +- ...ter-prefix-replace-with-port-http.out.yaml | 2 +- ...single-rule-with-exact-path-match.out.yaml | 2 +- ...h-prefix-and-exact-header-matches.out.yaml | 2 +- ...e-invalid-backend-refs-no-service.out.yaml | 2 +- ...to-gateway-with-wildcard-hostname.out.yaml | 2 +- ...to-gateway-with-wildcard-hostname.out.yaml | 2 +- internal/gatewayapi/translator.go | 6 +- 42 files changed, 219 insertions(+), 44 deletions(-) create mode 100644 internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners-with-different-ports.in.yaml create mode 100644 internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners-with-different-ports.out.yaml diff --git a/internal/gatewayapi/testdata/gateway-allows-same-namespace-with-allowed-httproute.out.yaml b/internal/gatewayapi/testdata/gateway-allows-same-namespace-with-allowed-httproute.out.yaml index b235850439d6..4ec6b5e9f859 100644 --- a/internal/gatewayapi/testdata/gateway-allows-same-namespace-with-allowed-httproute.out.yaml +++ b/internal/gatewayapi/testdata/gateway-allows-same-namespace-with-allowed-httproute.out.yaml @@ -81,7 +81,7 @@ infraIR: listeners: - address: "" ports: - - name: envoy-gateway-gateway-1 + - name: http protocol: "HTTP" servicePort: 80 containerPort: 10080 diff --git a/internal/gatewayapi/testdata/gateway-allows-same-namespace-with-disallowed-httproute.out.yaml b/internal/gatewayapi/testdata/gateway-allows-same-namespace-with-disallowed-httproute.out.yaml index 7b20f46c0b9a..ef0063b5b3ad 100644 --- a/internal/gatewayapi/testdata/gateway-allows-same-namespace-with-disallowed-httproute.out.yaml +++ b/internal/gatewayapi/testdata/gateway-allows-same-namespace-with-disallowed-httproute.out.yaml @@ -73,7 +73,7 @@ infraIR: listeners: - address: "" ports: - - name: envoy-gateway-gateway-1 + - name: http protocol: "HTTP" servicePort: 80 containerPort: 10080 diff --git a/internal/gatewayapi/testdata/gateway-with-listener-with-tls-secret-in-other-namespace-allowed-by-refgrant.out.yaml b/internal/gatewayapi/testdata/gateway-with-listener-with-tls-secret-in-other-namespace-allowed-by-refgrant.out.yaml index 9300be31b492..910d29210c60 100644 --- a/internal/gatewayapi/testdata/gateway-with-listener-with-tls-secret-in-other-namespace-allowed-by-refgrant.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-listener-with-tls-secret-in-other-namespace-allowed-by-refgrant.out.yaml @@ -89,7 +89,7 @@ infraIR: listeners: - address: "" ports: - - name: envoy-gateway-gateway-1 + - name: tls protocol: "HTTPS" servicePort: 443 containerPort: 10443 diff --git a/internal/gatewayapi/testdata/gateway-with-listener-with-valid-tls-configuration.out.yaml b/internal/gatewayapi/testdata/gateway-with-listener-with-valid-tls-configuration.out.yaml index ed8cb075cd1b..c13cd35b0741 100644 --- a/internal/gatewayapi/testdata/gateway-with-listener-with-valid-tls-configuration.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-listener-with-valid-tls-configuration.out.yaml @@ -88,7 +88,7 @@ infraIR: listeners: - address: "" ports: - - name: envoy-gateway-gateway-1 + - name: tls protocol: "HTTPS" servicePort: 443 containerPort: 10443 diff --git a/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners-with-different-ports.in.yaml b/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners-with-different-ports.in.yaml new file mode 100644 index 000000000000..fe57e8f0dbd8 --- /dev/null +++ b/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners-with-different-ports.in.yaml @@ -0,0 +1,52 @@ +gateways: + - apiVersion: gateway.networking.k8s.io/v1beta1 + kind: Gateway + metadata: + namespace: envoy-gateway + name: gateway-1 + spec: + gatewayClassName: envoy-gateway-class + listeners: + - name: http + protocol: HTTP + port: 80 + allowedRoutes: + namespaces: + from: All + - name: tls + protocol: HTTPS + port: 443 + allowedRoutes: + namespaces: + from: All + tls: + mode: Terminate + certificateRefs: + - name: tls-secret-1 +secrets: + - apiVersion: v1 + kind: Secret + metadata: + namespace: envoy-gateway + name: tls-secret-1 + type: kubernetes.io/tls + data: + tls.crt: Zm9vCg== + tls.key: YmFyCg== +httpRoutes: + - apiVersion: gateway.networking.k8s.io/v1beta1 + kind: HTTPRoute + metadata: + namespace: default + name: httproute-1 + spec: + parentRefs: + - namespace: envoy-gateway + name: gateway-1 + rules: + - matches: + - path: + value: "/" + backendRefs: + - name: service-1 + port: 8080 diff --git a/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners-with-different-ports.out.yaml b/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners-with-different-ports.out.yaml new file mode 100644 index 000000000000..8e1de4693907 --- /dev/null +++ b/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners-with-different-ports.out.yaml @@ -0,0 +1,127 @@ +gateways: + - apiVersion: gateway.networking.k8s.io/v1beta1 + kind: Gateway + metadata: + namespace: envoy-gateway + name: gateway-1 + spec: + gatewayClassName: envoy-gateway-class + listeners: + - name: http + protocol: HTTP + port: 80 + allowedRoutes: + namespaces: + from: All + - name: tls + protocol: HTTPS + port: 443 + allowedRoutes: + namespaces: + from: All + tls: + mode: Terminate + certificateRefs: + - name: tls-secret-1 + status: + listeners: + - name: http + supportedKinds: + - group: gateway.networking.k8s.io + kind: HTTPRoute + attachedRoutes: 1 + conditions: + - type: Ready + status: "True" + reason: Ready + message: Listener is ready + - name: tls + supportedKinds: + - group: gateway.networking.k8s.io + kind: HTTPRoute + attachedRoutes: 1 + conditions: + - type: Ready + status: "True" + reason: Ready + message: Listener is ready +httpRoutes: + - apiVersion: gateway.networking.k8s.io/v1beta1 + kind: HTTPRoute + metadata: + namespace: default + name: httproute-1 + spec: + parentRefs: + - namespace: envoy-gateway + name: gateway-1 + rules: + - matches: + - path: + value: "/" + backendRefs: + - name: service-1 + port: 8080 + status: + parents: + - parentRef: + namespace: envoy-gateway + name: gateway-1 + controllerName: gateway.envoyproxy.io/gatewayclass-controller + conditions: + - type: Accepted + status: "True" + reason: Accepted + message: Route is accepted +xdsIR: + envoy-gateway-gateway-1: + http: + - name: envoy-gateway-gateway-1-http + address: 0.0.0.0 + port: 10080 + hostnames: + - "*" + routes: + - name: default-httproute-1-rule-0-match-0-* + pathMatch: + prefix: "/" + destinations: + - host: 7.7.7.7 + port: 8080 + weight: 1 + - name: envoy-gateway-gateway-1-tls + address: 0.0.0.0 + port: 10443 + hostnames: + - "*" + tls: + serverCertificate: Zm9vCg== + privateKey: YmFyCg== + routes: + - name: default-httproute-1-rule-0-match-0-* + pathMatch: + prefix: "/" + destinations: + - host: 7.7.7.7 + port: 8080 + weight: 1 +infraIR: + envoy-gateway-gateway-1: + proxy: + metadata: + labels: + gateway.envoyproxy.io/owning-gateway-namespace: envoy-gateway + gateway.envoyproxy.io/owning-gateway-name: gateway-1 + name: envoy-gateway-gateway-1 + image: envoyproxy/envoy:v1.23-latest + listeners: + - address: "" + ports: + - name: http + protocol: "HTTP" + servicePort: 80 + containerPort: 10080 + - name: tls + protocol: "HTTPS" + servicePort: 443 + containerPort: 10443 diff --git a/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners.out.yaml b/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners.out.yaml index 09347d78682e..32bcf4d84095 100644 --- a/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners.out.yaml +++ b/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners.out.yaml @@ -112,7 +112,7 @@ infraIR: listeners: - address: "" ports: - - name: envoy-gateway-gateway-1 + - name: http-1 protocol: "HTTP" servicePort: 80 containerPort: 10080 diff --git a/internal/gatewayapi/testdata/httproute-attaching-to-gateway.out.yaml b/internal/gatewayapi/testdata/httproute-attaching-to-gateway.out.yaml index 585a08cc296f..03294c5496fa 100644 --- a/internal/gatewayapi/testdata/httproute-attaching-to-gateway.out.yaml +++ b/internal/gatewayapi/testdata/httproute-attaching-to-gateway.out.yaml @@ -81,7 +81,7 @@ infraIR: listeners: - address: "" ports: - - name: envoy-gateway-gateway-1 + - name: http protocol: "HTTP" servicePort: 80 containerPort: 10080 diff --git a/internal/gatewayapi/testdata/httproute-attaching-to-listener-on-gateway-with-two-listeners.out.yaml b/internal/gatewayapi/testdata/httproute-attaching-to-listener-on-gateway-with-two-listeners.out.yaml index 2c43ed215c19..29157f1eeb43 100644 --- a/internal/gatewayapi/testdata/httproute-attaching-to-listener-on-gateway-with-two-listeners.out.yaml +++ b/internal/gatewayapi/testdata/httproute-attaching-to-listener-on-gateway-with-two-listeners.out.yaml @@ -106,7 +106,7 @@ infraIR: listeners: - address: "" ports: - - name: envoy-gateway-gateway-1 + - name: http-1 protocol: "HTTP" servicePort: 80 containerPort: 10080 diff --git a/internal/gatewayapi/testdata/httproute-attaching-to-listener.out.yaml b/internal/gatewayapi/testdata/httproute-attaching-to-listener.out.yaml index 4cf174cf82e7..6e384d6ba51e 100644 --- a/internal/gatewayapi/testdata/httproute-attaching-to-listener.out.yaml +++ b/internal/gatewayapi/testdata/httproute-attaching-to-listener.out.yaml @@ -83,7 +83,7 @@ infraIR: listeners: - address: "" ports: - - name: envoy-gateway-gateway-1 + - name: http protocol: "HTTP" servicePort: 80 containerPort: 10080 diff --git a/internal/gatewayapi/testdata/httproute-rule-with-multiple-backends-and-no-weights.out.yaml b/internal/gatewayapi/testdata/httproute-rule-with-multiple-backends-and-no-weights.out.yaml index d868b9b99e10..907102e5e299 100644 --- a/internal/gatewayapi/testdata/httproute-rule-with-multiple-backends-and-no-weights.out.yaml +++ b/internal/gatewayapi/testdata/httproute-rule-with-multiple-backends-and-no-weights.out.yaml @@ -91,7 +91,7 @@ infraIR: listeners: - address: "" ports: - - name: envoy-gateway-gateway-1 + - name: http protocol: "HTTP" servicePort: 80 containerPort: 10080 diff --git a/internal/gatewayapi/testdata/httproute-rule-with-multiple-backends-and-weights.out.yaml b/internal/gatewayapi/testdata/httproute-rule-with-multiple-backends-and-weights.out.yaml index 3bb4acf4fbb6..98233570d758 100644 --- a/internal/gatewayapi/testdata/httproute-rule-with-multiple-backends-and-weights.out.yaml +++ b/internal/gatewayapi/testdata/httproute-rule-with-multiple-backends-and-weights.out.yaml @@ -94,7 +94,7 @@ infraIR: listeners: - address: "" ports: - - name: envoy-gateway-gateway-1 + - name: http protocol: "HTTP" servicePort: 80 containerPort: 10080 diff --git a/internal/gatewayapi/testdata/httproute-with-backendref-in-other-namespace-allowed-by-refgrant.out.yaml b/internal/gatewayapi/testdata/httproute-with-backendref-in-other-namespace-allowed-by-refgrant.out.yaml index 412ff30e360d..6f2809ff6e86 100644 --- a/internal/gatewayapi/testdata/httproute-with-backendref-in-other-namespace-allowed-by-refgrant.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-backendref-in-other-namespace-allowed-by-refgrant.out.yaml @@ -83,7 +83,7 @@ infraIR: listeners: - address: "" ports: - - name: envoy-gateway-gateway-1 + - name: http protocol: "HTTP" servicePort: 80 containerPort: 10080 diff --git a/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-add-multiple-filters.out.yaml b/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-add-multiple-filters.out.yaml index 1b61aabdb918..1408cc0eae47 100644 --- a/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-add-multiple-filters.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-add-multiple-filters.out.yaml @@ -118,7 +118,7 @@ infraIR: listeners: - address: "" ports: - - name: envoy-gateway-gateway-1 + - name: http protocol: "HTTP" containerPort: 10080 servicePort: 80 diff --git a/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-adds.out.yaml b/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-adds.out.yaml index bf5b06aa8203..011724c4560a 100644 --- a/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-adds.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-adds.out.yaml @@ -135,7 +135,7 @@ infraIR: listeners: - address: "" ports: - - name: envoy-gateway-gateway-1 + - name: http protocol: "HTTP" containerPort: 10080 servicePort: 80 diff --git a/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-remove-multiple-filters.out.yaml b/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-remove-multiple-filters.out.yaml index 032b70bcb4e2..003288773a2b 100644 --- a/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-remove-multiple-filters.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-remove-multiple-filters.out.yaml @@ -108,7 +108,7 @@ infraIR: listeners: - address: "" ports: - - name: envoy-gateway-gateway-1 + - name: http protocol: "HTTP" containerPort: 10080 servicePort: 80 diff --git a/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-removes.out.yaml b/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-removes.out.yaml index 6d27911705e5..7123200aff5f 100644 --- a/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-removes.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-removes.out.yaml @@ -101,7 +101,7 @@ infraIR: listeners: - address: "" ports: - - name: envoy-gateway-gateway-1 + - name: http protocol: "HTTP" containerPort: 10080 servicePort: 80 diff --git a/internal/gatewayapi/testdata/httproute-with-header-filter-empty-header-values.out.yaml b/internal/gatewayapi/testdata/httproute-with-header-filter-empty-header-values.out.yaml index 8f04a8aca23f..aa8c5e0ceffc 100644 --- a/internal/gatewayapi/testdata/httproute-with-header-filter-empty-header-values.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-header-filter-empty-header-values.out.yaml @@ -105,7 +105,7 @@ infraIR: listeners: - address: "" ports: - - name: envoy-gateway-gateway-1 + - name: http protocol: "HTTP" containerPort: 10080 servicePort: 80 diff --git a/internal/gatewayapi/testdata/httproute-with-header-filter-empty-headers.out.yaml b/internal/gatewayapi/testdata/httproute-with-header-filter-empty-headers.out.yaml index 965899f12792..238545928ddf 100644 --- a/internal/gatewayapi/testdata/httproute-with-header-filter-empty-headers.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-header-filter-empty-headers.out.yaml @@ -108,7 +108,7 @@ infraIR: listeners: - address: "" ports: - - name: envoy-gateway-gateway-1 + - name: http protocol: "HTTP" containerPort: 10080 servicePort: 80 diff --git a/internal/gatewayapi/testdata/httproute-with-header-filter-invalid-headers.out.yaml b/internal/gatewayapi/testdata/httproute-with-header-filter-invalid-headers.out.yaml index b8af39ab017b..e8d0ff095471 100644 --- a/internal/gatewayapi/testdata/httproute-with-header-filter-invalid-headers.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-header-filter-invalid-headers.out.yaml @@ -108,7 +108,7 @@ infraIR: listeners: - address: "" ports: - - name: envoy-gateway-gateway-1 + - name: http protocol: "HTTP" containerPort: 10080 servicePort: 80 diff --git a/internal/gatewayapi/testdata/httproute-with-header-filter-no-headers.out.yaml b/internal/gatewayapi/testdata/httproute-with-header-filter-no-headers.out.yaml index 9439ff3784b0..d7e95be2b3ea 100644 --- a/internal/gatewayapi/testdata/httproute-with-header-filter-no-headers.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-header-filter-no-headers.out.yaml @@ -95,7 +95,7 @@ infraIR: listeners: - address: "" ports: - - name: envoy-gateway-gateway-1 + - name: http protocol: "HTTP" containerPort: 10080 servicePort: 80 diff --git a/internal/gatewayapi/testdata/httproute-with-header-filter-no-valid-headers.out.yaml b/internal/gatewayapi/testdata/httproute-with-header-filter-no-valid-headers.out.yaml index 34f5872ef8bf..a63a937bb2ba 100644 --- a/internal/gatewayapi/testdata/httproute-with-header-filter-no-valid-headers.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-header-filter-no-valid-headers.out.yaml @@ -99,7 +99,7 @@ infraIR: listeners: - address: "" ports: - - name: envoy-gateway-gateway-1 + - name: http protocol: "HTTP" containerPort: 10080 servicePort: 80 diff --git a/internal/gatewayapi/testdata/httproute-with-header-filter-remove.out.yaml b/internal/gatewayapi/testdata/httproute-with-header-filter-remove.out.yaml index bc14605f6366..40d0556f5ef2 100644 --- a/internal/gatewayapi/testdata/httproute-with-header-filter-remove.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-header-filter-remove.out.yaml @@ -100,7 +100,7 @@ infraIR: listeners: - address: "" ports: - - name: envoy-gateway-gateway-1 + - name: http protocol: "HTTP" containerPort: 10080 servicePort: 80 diff --git a/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-bad-port.out.yaml b/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-bad-port.out.yaml index 3a8937dfc33a..18fc9ff2c891 100644 --- a/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-bad-port.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-bad-port.out.yaml @@ -86,7 +86,7 @@ infraIR: listeners: - address: "" ports: - - name: envoy-gateway-gateway-1 + - name: http protocol: "HTTP" containerPort: 10080 servicePort: 80 diff --git a/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-invalid-group.out.yaml b/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-invalid-group.out.yaml index b80cea2d2827..92d17de3237f 100644 --- a/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-invalid-group.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-invalid-group.out.yaml @@ -88,7 +88,7 @@ infraIR: listeners: - address: "" ports: - - name: envoy-gateway-gateway-1 + - name: http protocol: "HTTP" containerPort: 10080 servicePort: 80 diff --git a/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-invalid-kind.out.yaml b/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-invalid-kind.out.yaml index eeb85899417b..a0b76319001f 100644 --- a/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-invalid-kind.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-invalid-kind.out.yaml @@ -87,7 +87,7 @@ infraIR: listeners: - address: "" ports: - - name: envoy-gateway-gateway-1 + - name: http protocol: "HTTP" containerPort: 10080 servicePort: 80 diff --git a/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-no-port.out.yaml b/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-no-port.out.yaml index fe3a7ee1d5ac..634ed1b1bcbc 100644 --- a/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-no-port.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-no-port.out.yaml @@ -85,7 +85,7 @@ infraIR: listeners: - address: "" ports: - - name: envoy-gateway-gateway-1 + - name: http protocol: "HTTP" containerPort: 10080 servicePort: 80 diff --git a/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-no-service.out.yaml b/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-no-service.out.yaml index 52c64626be9c..4dfdd8dd667a 100644 --- a/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-no-service.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-no-service.out.yaml @@ -86,7 +86,7 @@ infraIR: listeners: - address: "" ports: - - name: envoy-gateway-gateway-1 + - name: http protocol: "HTTP" containerPort: 10080 servicePort: 80 diff --git a/internal/gatewayapi/testdata/httproute-with-invalid-backendref-in-other-namespace.out.yaml b/internal/gatewayapi/testdata/httproute-with-invalid-backendref-in-other-namespace.out.yaml index f68bc3140836..1ffa12050ddd 100644 --- a/internal/gatewayapi/testdata/httproute-with-invalid-backendref-in-other-namespace.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-invalid-backendref-in-other-namespace.out.yaml @@ -87,7 +87,7 @@ infraIR: listeners: - address: "" ports: - - name: envoy-gateway-gateway-1 + - name: http protocol: "HTTP" servicePort: 80 containerPort: 10080 diff --git a/internal/gatewayapi/testdata/httproute-with-non-matching-specific-hostname-attaching-to-gateway-with-wildcard-hostname.out.yaml b/internal/gatewayapi/testdata/httproute-with-non-matching-specific-hostname-attaching-to-gateway-with-wildcard-hostname.out.yaml index 6d998378bab8..3bb183f14756 100644 --- a/internal/gatewayapi/testdata/httproute-with-non-matching-specific-hostname-attaching-to-gateway-with-wildcard-hostname.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-non-matching-specific-hostname-attaching-to-gateway-with-wildcard-hostname.out.yaml @@ -76,7 +76,7 @@ infraIR: listeners: - address: "" ports: - - name: envoy-gateway-gateway-1 + - name: http protocol: "HTTP" containerPort: 10080 servicePort: 80 diff --git a/internal/gatewayapi/testdata/httproute-with-redirect-filter-full-path-replace-https.out.yaml b/internal/gatewayapi/testdata/httproute-with-redirect-filter-full-path-replace-https.out.yaml index 3d1454eaa2b7..3d42bf63d9e4 100644 --- a/internal/gatewayapi/testdata/httproute-with-redirect-filter-full-path-replace-https.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-redirect-filter-full-path-replace-https.out.yaml @@ -98,7 +98,7 @@ infraIR: listeners: - address: "" ports: - - name: envoy-gateway-gateway-1 + - name: http protocol: "HTTP" containerPort: 10080 servicePort: 80 diff --git a/internal/gatewayapi/testdata/httproute-with-redirect-filter-hostname.out.yaml b/internal/gatewayapi/testdata/httproute-with-redirect-filter-hostname.out.yaml index dbcae91ef3aa..79ffd78cdd0f 100644 --- a/internal/gatewayapi/testdata/httproute-with-redirect-filter-hostname.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-redirect-filter-hostname.out.yaml @@ -95,7 +95,7 @@ infraIR: listeners: - address: "" ports: - - name: envoy-gateway-gateway-1 + - name: http protocol: "HTTP" containerPort: 10080 servicePort: 80 diff --git a/internal/gatewayapi/testdata/httproute-with-redirect-filter-invalid-filter-type.out.yaml b/internal/gatewayapi/testdata/httproute-with-redirect-filter-invalid-filter-type.out.yaml index c0ec27ff1d6d..7a210ae376e7 100644 --- a/internal/gatewayapi/testdata/httproute-with-redirect-filter-invalid-filter-type.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-redirect-filter-invalid-filter-type.out.yaml @@ -99,7 +99,7 @@ infraIR: listeners: - address: "" ports: - - name: envoy-gateway-gateway-1 + - name: http protocol: "HTTP" containerPort: 10080 servicePort: 80 diff --git a/internal/gatewayapi/testdata/httproute-with-redirect-filter-invalid-scheme.out.yaml b/internal/gatewayapi/testdata/httproute-with-redirect-filter-invalid-scheme.out.yaml index 10bb78320878..a663120def3a 100644 --- a/internal/gatewayapi/testdata/httproute-with-redirect-filter-invalid-scheme.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-redirect-filter-invalid-scheme.out.yaml @@ -100,7 +100,7 @@ infraIR: listeners: - address: "" ports: - - name: envoy-gateway-gateway-1 + - name: http protocol: "HTTP" containerPort: 10080 servicePort: 80 diff --git a/internal/gatewayapi/testdata/httproute-with-redirect-filter-invalid-status.out.yaml b/internal/gatewayapi/testdata/httproute-with-redirect-filter-invalid-status.out.yaml index ef25716b9d8a..998d188aa3a5 100644 --- a/internal/gatewayapi/testdata/httproute-with-redirect-filter-invalid-status.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-redirect-filter-invalid-status.out.yaml @@ -100,7 +100,7 @@ infraIR: listeners: - address: "" ports: - - name: envoy-gateway-gateway-1 + - name: http protocol: "HTTP" containerPort: 10080 servicePort: 80 diff --git a/internal/gatewayapi/testdata/httproute-with-redirect-filter-prefix-replace-with-port-http.out.yaml b/internal/gatewayapi/testdata/httproute-with-redirect-filter-prefix-replace-with-port-http.out.yaml index c0fe9e1bc718..59361b9ede0f 100644 --- a/internal/gatewayapi/testdata/httproute-with-redirect-filter-prefix-replace-with-port-http.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-redirect-filter-prefix-replace-with-port-http.out.yaml @@ -100,7 +100,7 @@ infraIR: listeners: - address: "" ports: - - name: envoy-gateway-gateway-1 + - name: http protocol: "HTTP" containerPort: 10080 servicePort: 80 diff --git a/internal/gatewayapi/testdata/httproute-with-single-rule-with-exact-path-match.out.yaml b/internal/gatewayapi/testdata/httproute-with-single-rule-with-exact-path-match.out.yaml index 5721027d02fb..0e074c278b5b 100644 --- a/internal/gatewayapi/testdata/httproute-with-single-rule-with-exact-path-match.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-single-rule-with-exact-path-match.out.yaml @@ -82,7 +82,7 @@ infraIR: listeners: - address: "" ports: - - name: envoy-gateway-gateway-1 + - name: http protocol: "HTTP" servicePort: 80 containerPort: 10080 diff --git a/internal/gatewayapi/testdata/httproute-with-single-rule-with-path-prefix-and-exact-header-matches.out.yaml b/internal/gatewayapi/testdata/httproute-with-single-rule-with-path-prefix-and-exact-header-matches.out.yaml index 971fbd9320d3..cc0b48125525 100644 --- a/internal/gatewayapi/testdata/httproute-with-single-rule-with-path-prefix-and-exact-header-matches.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-single-rule-with-path-prefix-and-exact-header-matches.out.yaml @@ -91,7 +91,7 @@ infraIR: listeners: - address: "" ports: - - name: envoy-gateway-gateway-1 + - name: http protocol: "HTTP" serviceport: 80 containerPort: 10080 diff --git a/internal/gatewayapi/testdata/httproute-with-some-invalid-backend-refs-no-service.out.yaml b/internal/gatewayapi/testdata/httproute-with-some-invalid-backend-refs-no-service.out.yaml index eaab5cb60709..0a657f4ffd73 100644 --- a/internal/gatewayapi/testdata/httproute-with-some-invalid-backend-refs-no-service.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-some-invalid-backend-refs-no-service.out.yaml @@ -93,7 +93,7 @@ infraIR: listeners: - address: "" ports: - - name: envoy-gateway-gateway-1 + - name: http protocol: "HTTP" containerPort: 10080 servicePort: 80 diff --git a/internal/gatewayapi/testdata/httproute-with-specific-hostname-attaching-to-gateway-with-wildcard-hostname.out.yaml b/internal/gatewayapi/testdata/httproute-with-specific-hostname-attaching-to-gateway-with-wildcard-hostname.out.yaml index 387cdabd3ead..feb6375de05b 100644 --- a/internal/gatewayapi/testdata/httproute-with-specific-hostname-attaching-to-gateway-with-wildcard-hostname.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-specific-hostname-attaching-to-gateway-with-wildcard-hostname.out.yaml @@ -87,7 +87,7 @@ infraIR: listeners: - address: "" ports: - - name: envoy-gateway-gateway-1 + - name: http protocol: "HTTP" servicePort: 80 containerPort: 10080 diff --git a/internal/gatewayapi/testdata/httproute-with-two-specific-hostnames-attaching-to-gateway-with-wildcard-hostname.out.yaml b/internal/gatewayapi/testdata/httproute-with-two-specific-hostnames-attaching-to-gateway-with-wildcard-hostname.out.yaml index 68f6150787cb..f632488ce31f 100644 --- a/internal/gatewayapi/testdata/httproute-with-two-specific-hostnames-attaching-to-gateway-with-wildcard-hostname.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-two-specific-hostnames-attaching-to-gateway-with-wildcard-hostname.out.yaml @@ -98,7 +98,7 @@ infraIR: listeners: - address: "" ports: - - name: envoy-gateway-gateway-1 + - name: http protocol: "HTTP" servicePort: 80 containerPort: 10080 diff --git a/internal/gatewayapi/translator.go b/internal/gatewayapi/translator.go index 52ec4e7e803d..2e403f025652 100644 --- a/internal/gatewayapi/translator.go +++ b/internal/gatewayapi/translator.go @@ -482,7 +482,7 @@ func (t *Translator) ProcessListeners(gateways []*GatewayContext, xdsIR XdsIRMap proto = ir.HTTPSProtocolType } infraPort := ir.ListenerPort{ - Name: irInfraPortName(listener), + Name: string(listener.Name), Protocol: proto, ServicePort: servicePort, ContainerPort: containerPort, @@ -1225,10 +1225,6 @@ func irListenerName(listener *ListenerContext) string { return fmt.Sprintf("%s-%s-%s", listener.gateway.Namespace, listener.gateway.Name, listener.Name) } -func irInfraPortName(listener *ListenerContext) string { - return fmt.Sprintf("%s-%s", listener.gateway.Namespace, listener.gateway.Name) -} - func routeName(httpRoute *HTTPRouteContext, ruleIdx, matchIdx int) string { return fmt.Sprintf("%s-%s-rule-%d-match-%d", httpRoute.Namespace, httpRoute.Name, ruleIdx, matchIdx) }