diff --git a/pkg/plugins/policies/meshhttproute/plugin/v1alpha1/plugin_test.go b/pkg/plugins/policies/meshhttproute/plugin/v1alpha1/plugin_test.go index ee71438ea335..eb715ea66c14 100644 --- a/pkg/plugins/policies/meshhttproute/plugin/v1alpha1/plugin_test.go +++ b/pkg/plugins/policies/meshhttproute/plugin/v1alpha1/plugin_test.go @@ -579,7 +579,7 @@ var _ = Describe("MeshHTTPRoute", func() { Matches: []api.Match{{ Path: &api.PathMatch{ Type: api.PathPrefix, - Value: "/", + Value: "/wild", }, }}, Default: api.RuleConf{ @@ -599,7 +599,7 @@ var _ = Describe("MeshHTTPRoute", func() { Matches: []api.Match{{ Path: &api.PathMatch{ Type: api.PathPrefix, - Value: "/go", + Value: "/go-dev", }, }}, Default: api.RuleConf{ @@ -619,7 +619,7 @@ var _ = Describe("MeshHTTPRoute", func() { Matches: []api.Match{{ Path: &api.PathMatch{ Type: api.PathPrefix, - Value: "/wild", + Value: "/wild-dev", }, }}, Default: api.RuleConf{ @@ -639,7 +639,7 @@ var _ = Describe("MeshHTTPRoute", func() { Matches: []api.Match{{ Path: &api.PathMatch{ Type: api.PathPrefix, - Value: "/other", + Value: "/other-dev", }, }}, Default: api.RuleConf{ @@ -727,7 +727,7 @@ var _ = Describe("MeshHTTPRoute", func() { Matches: []api.Match{{ Path: &api.PathMatch{ Type: api.PathPrefix, - Value: "/", + Value: "/wild", }, }}, Default: api.RuleConf{ @@ -747,7 +747,7 @@ var _ = Describe("MeshHTTPRoute", func() { Matches: []api.Match{{ Path: &api.PathMatch{ Type: api.PathPrefix, - Value: "/go", + Value: "/go-dev", }, }}, Default: api.RuleConf{ diff --git a/pkg/plugins/policies/meshhttproute/plugin/v1alpha1/testdata/gateway-listener-specific.routes.golden.yaml b/pkg/plugins/policies/meshhttproute/plugin/v1alpha1/testdata/gateway-listener-specific.routes.golden.yaml index 99f747fbdd25..fce84239541d 100644 --- a/pkg/plugins/policies/meshhttproute/plugin/v1alpha1/testdata/gateway-listener-specific.routes.golden.yaml +++ b/pkg/plugins/policies/meshhttproute/plugin/v1alpha1/testdata/gateway-listener-specific.routes.golden.yaml @@ -13,7 +13,20 @@ resources: name: '*' routes: - match: - prefix: / + path: /wild + route: + clusterNotFoundResponseCode: INTERNAL_SERVER_ERROR + idleTimeout: 5s + weightedClusters: + clusters: + - name: backend-26cb64fa4e85e7b7 + requestHeadersToAdd: + - header: + key: x-kuma-tags + value: '&kuma.io/service=sample-gateway&' + weight: 100 + - match: + prefix: /wild/ route: clusterNotFoundResponseCode: INTERNAL_SERVER_ERROR idleTimeout: 5s @@ -39,7 +52,7 @@ resources: name: go.dev routes: - match: - path: /go + path: /go-dev route: clusterNotFoundResponseCode: INTERNAL_SERVER_ERROR idleTimeout: 5s @@ -52,7 +65,7 @@ resources: value: '&kuma.io/service=sample-gateway&' weight: 100 - match: - prefix: /go/ + prefix: /go-dev/ route: clusterNotFoundResponseCode: INTERNAL_SERVER_ERROR idleTimeout: 5s diff --git a/pkg/plugins/policies/meshhttproute/plugin/v1alpha1/testdata/gateway.routes.golden.yaml b/pkg/plugins/policies/meshhttproute/plugin/v1alpha1/testdata/gateway.routes.golden.yaml index abace70be999..ce094a4524bf 100644 --- a/pkg/plugins/policies/meshhttproute/plugin/v1alpha1/testdata/gateway.routes.golden.yaml +++ b/pkg/plugins/policies/meshhttproute/plugin/v1alpha1/testdata/gateway.routes.golden.yaml @@ -13,7 +13,20 @@ resources: name: other.dev routes: - match: - path: /other + path: /other-dev + route: + clusterNotFoundResponseCode: INTERNAL_SERVER_ERROR + idleTimeout: 5s + weightedClusters: + clusters: + - name: backend-26cb64fa4e85e7b7 + requestHeadersToAdd: + - header: + key: x-kuma-tags + value: '&kuma.io/service=sample-gateway&' + weight: 100 + - match: + path: /wild-dev route: clusterNotFoundResponseCode: INTERNAL_SERVER_ERROR idleTimeout: 5s @@ -39,7 +52,7 @@ resources: value: '&kuma.io/service=sample-gateway&' weight: 100 - match: - prefix: /other/ + prefix: /other-dev/ route: clusterNotFoundResponseCode: INTERNAL_SERVER_ERROR idleTimeout: 5s @@ -52,7 +65,7 @@ resources: value: '&kuma.io/service=sample-gateway&' weight: 100 - match: - prefix: /wild/ + prefix: /wild-dev/ route: clusterNotFoundResponseCode: INTERNAL_SERVER_ERROR idleTimeout: 5s @@ -65,7 +78,7 @@ resources: value: '&kuma.io/service=sample-gateway&' weight: 100 - match: - prefix: / + prefix: /wild/ route: clusterNotFoundResponseCode: INTERNAL_SERVER_ERROR idleTimeout: 5s @@ -82,7 +95,7 @@ resources: name: go.dev routes: - match: - path: /wild + path: /wild-dev route: clusterNotFoundResponseCode: INTERNAL_SERVER_ERROR idleTimeout: 5s @@ -95,7 +108,7 @@ resources: value: '&kuma.io/service=sample-gateway&' weight: 100 - match: - path: /go + path: /go-dev route: clusterNotFoundResponseCode: INTERNAL_SERVER_ERROR idleTimeout: 5s @@ -108,7 +121,7 @@ resources: value: '&kuma.io/service=sample-gateway&' weight: 100 - match: - prefix: /wild/ + path: /wild route: clusterNotFoundResponseCode: INTERNAL_SERVER_ERROR idleTimeout: 5s @@ -121,7 +134,7 @@ resources: value: '&kuma.io/service=sample-gateway&' weight: 100 - match: - prefix: /go/ + prefix: /wild-dev/ route: clusterNotFoundResponseCode: INTERNAL_SERVER_ERROR idleTimeout: 5s @@ -134,7 +147,20 @@ resources: value: '&kuma.io/service=sample-gateway&' weight: 100 - match: - prefix: / + prefix: /go-dev/ + route: + clusterNotFoundResponseCode: INTERNAL_SERVER_ERROR + idleTimeout: 5s + weightedClusters: + clusters: + - name: backend-26cb64fa4e85e7b7 + requestHeadersToAdd: + - header: + key: x-kuma-tags + value: '&kuma.io/service=sample-gateway&' + weight: 100 + - match: + prefix: /wild/ route: clusterNotFoundResponseCode: INTERNAL_SERVER_ERROR idleTimeout: 5s @@ -150,6 +176,19 @@ resources: - '*.dev' name: '*.dev' routes: + - match: + path: /wild-dev + route: + clusterNotFoundResponseCode: INTERNAL_SERVER_ERROR + idleTimeout: 5s + weightedClusters: + clusters: + - name: backend-26cb64fa4e85e7b7 + requestHeadersToAdd: + - header: + key: x-kuma-tags + value: '&kuma.io/service=sample-gateway&' + weight: 100 - match: path: /wild route: @@ -164,7 +203,7 @@ resources: value: '&kuma.io/service=sample-gateway&' weight: 100 - match: - prefix: /wild/ + prefix: /wild-dev/ route: clusterNotFoundResponseCode: INTERNAL_SERVER_ERROR idleTimeout: 5s @@ -177,7 +216,7 @@ resources: value: '&kuma.io/service=sample-gateway&' weight: 100 - match: - prefix: / + prefix: /wild/ route: clusterNotFoundResponseCode: INTERNAL_SERVER_ERROR idleTimeout: 5s @@ -194,7 +233,20 @@ resources: name: '*' routes: - match: - prefix: / + path: /wild + route: + clusterNotFoundResponseCode: INTERNAL_SERVER_ERROR + idleTimeout: 5s + weightedClusters: + clusters: + - name: backend-26cb64fa4e85e7b7 + requestHeadersToAdd: + - header: + key: x-kuma-tags + value: '&kuma.io/service=sample-gateway&' + weight: 100 + - match: + prefix: /wild/ route: clusterNotFoundResponseCode: INTERNAL_SERVER_ERROR idleTimeout: 5s @@ -220,7 +272,7 @@ resources: name: go.dev routes: - match: - path: /wild + path: /wild-dev route: clusterNotFoundResponseCode: INTERNAL_SERVER_ERROR idleTimeout: 5s @@ -233,7 +285,7 @@ resources: value: '&kuma.io/service=sample-gateway&' weight: 100 - match: - path: /go + path: /go-dev route: clusterNotFoundResponseCode: INTERNAL_SERVER_ERROR idleTimeout: 5s @@ -246,7 +298,20 @@ resources: value: '&kuma.io/service=sample-gateway&' weight: 100 - match: - prefix: /wild/ + path: /wild + route: + clusterNotFoundResponseCode: INTERNAL_SERVER_ERROR + idleTimeout: 5s + weightedClusters: + clusters: + - name: backend-26cb64fa4e85e7b7 + requestHeadersToAdd: + - header: + key: x-kuma-tags + value: '&kuma.io/service=sample-gateway&' + weight: 100 + - match: + prefix: /wild-dev/ route: clusterNotFoundResponseCode: INTERNAL_SERVER_ERROR idleTimeout: 5s @@ -259,7 +324,7 @@ resources: value: '&kuma.io/service=sample-gateway&' weight: 100 - match: - prefix: /go/ + prefix: /go-dev/ route: clusterNotFoundResponseCode: INTERNAL_SERVER_ERROR idleTimeout: 5s @@ -272,7 +337,7 @@ resources: value: '&kuma.io/service=sample-gateway&' weight: 100 - match: - prefix: / + prefix: /wild/ route: clusterNotFoundResponseCode: INTERNAL_SERVER_ERROR idleTimeout: 5s