From c5dd146867b1918dd1f38d9d10770b843fcf11fc Mon Sep 17 00:00:00 2001 From: Harinder Singh Date: Wed, 7 Feb 2024 22:43:13 +0530 Subject: [PATCH 1/2] INFRA-2824 | Harinder | Bug fix: Kong rate limit config was incorrect in case a user was doing rate limit on header --- .../fixtures/kube_objects/kube_object_commonapigateways.json | 2 +- .../manifest/expected_output/dev-testapp-api-gateway-1.json | 2 +- templates/common_api_gateway.jsonnet | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/resources/fixtures/kube_objects/kube_object_commonapigateways.json b/src/test/resources/fixtures/kube_objects/kube_object_commonapigateways.json index 3f417e1a..a3eb4c3e 100644 --- a/src/test/resources/fixtures/kube_objects/kube_object_commonapigateways.json +++ b/src/test/resources/fixtures/kube_objects/kube_object_commonapigateways.json @@ -1175,7 +1175,7 @@ { "apiVersion": "configuration.konghq.com/v1", "config": { - "header": "hello-world", + "header_name": "hello-world", "limit_by": "header", "minute": 60 }, diff --git a/src/test/resources/fixtures/manifest/expected_output/dev-testapp-api-gateway-1.json b/src/test/resources/fixtures/manifest/expected_output/dev-testapp-api-gateway-1.json index 71f34a58..9fa75084 100644 --- a/src/test/resources/fixtures/manifest/expected_output/dev-testapp-api-gateway-1.json +++ b/src/test/resources/fixtures/manifest/expected_output/dev-testapp-api-gateway-1.json @@ -21,7 +21,7 @@ { "name": "efgh", "limit": 60, - "header": "hello-world", + "header_name": "hello-world", "options": "header" } ], diff --git a/templates/common_api_gateway.jsonnet b/templates/common_api_gateway.jsonnet index 73392ec0..1535b7ad 100644 --- a/templates/common_api_gateway.jsonnet +++ b/templates/common_api_gateway.jsonnet @@ -163,7 +163,7 @@ local create_kong_rate_limiter(environment, servicePrefix, typeIdentifier, gatew minute: rule.limit, limit_by: '%s' % rule.options, [if rule.options == 'path' then 'path' else null]: '%s' % forTheGateway, - [if rule.options == 'header' then 'header' else null]: '%s' % rule.header, + [if rule.options == 'header' then 'header_name' else null]: '%s' % rule.header, }, } for rule in rateLimitRules], }; From 31dc7c999895146f4d91b8aa6eb038999a55061c Mon Sep 17 00:00:00 2001 From: Harinder Singh Date: Thu, 8 Feb 2024 11:30:09 +0530 Subject: [PATCH 2/2] INFRA-2824 | Harinder | Bug fix: Kong rate limit config was incorrect in case a user was doing rate limit on header. Updating test data --- .../manifest/expected_output/dev-testapp-api-gateway-1.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/resources/fixtures/manifest/expected_output/dev-testapp-api-gateway-1.json b/src/test/resources/fixtures/manifest/expected_output/dev-testapp-api-gateway-1.json index 9fa75084..71f34a58 100644 --- a/src/test/resources/fixtures/manifest/expected_output/dev-testapp-api-gateway-1.json +++ b/src/test/resources/fixtures/manifest/expected_output/dev-testapp-api-gateway-1.json @@ -21,7 +21,7 @@ { "name": "efgh", "limit": 60, - "header_name": "hello-world", + "header": "hello-world", "options": "header" } ],