Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

feat: version compatibility for aws-lambda mutually-exclusive fields #313

Merged
merged 5 commits into from
Jul 27, 2022

Conversation

GGabriele
Copy link
Contributor

@GGabriele GGabriele commented Jul 22, 2022

According to 3.x changes, this commit removes the mutually-exclusivity
check for the 'aws_region' and 'host' fields. From a version
compatibility perspective, this is not a problem for existing DPs
upgrading to 3.x because they are supposed to run with a good
configuration (which is going to work fine in 3.x as well), but may
be an issue for mixed setup (3.x and 2.x DPs at the same time)
or downgrades.

In order to prevent to impact older DPs, koko will make the call
to drop the 'host' field in the case of both the 'aws_region' and
'host' fields are set.

Kong related changes.

@GGabriele GGabriele requested a review from a team as a code owner July 22, 2022 16:32
@GGabriele GGabriele force-pushed the feat/aws-lambda-vc branch from bae5b32 to 16760cd Compare July 22, 2022 16:43
According to 3.x changes, this commit removes the mutually-exclusivity
check for the 'aws_region' and 'host' fields. From a version
compatibility perspective, this is not a problem for existing DPs
upgrading to 3.x because they are supposed to run with a good
configuration (which is going to work fine in 3.x as well), but may
be an issue for mixed setup (3.x and 2.x DPs at the same time)
or downgrades.

In order to prevent to impact older DPs, koko will make the call
to drop the 'host' field in the case of both the 'aws_region' and
'host' fields are set.
@GGabriele GGabriele force-pushed the feat/aws-lambda-vc branch from 16760cd to 5a2d8e8 Compare July 22, 2022 17:32
updatedRaw := res.Raw
awsRegionResult := gjson.Get(res.Raw, "config.aws_region")
hostResult := gjson.Get(res.Raw, "config.host")
// 'aws_region' and 'host' used to be mutually exclusive fields but
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// 'aws_region' and 'host' used to be mutually exclusive fields but
// 'aws_region' and 'host' were mutually exclusive fields until Kong version 2.8

@hbagdi
Copy link
Member

hbagdi commented Jul 22, 2022

The approach isn't ideal but it does seem reasonable to me.

@GGabriele GGabriele requested review from tjasko, hbagdi and mikefero July 27, 2022 08:17
mikefero
mikefero previously approved these changes Jul 27, 2022
@GGabriele
Copy link
Contributor Author

@hbagdi are we good with this or you want to discuss this further?

tjasko
tjasko previously approved these changes Jul 27, 2022
@@ -70,6 +70,7 @@ func TestVersionCompatibility(t *testing.T) {
id: uuid.NewString(),
config: `{
"aws_region": "AWS_REGION",
"host": "192.168.1.1",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs description.
Like I've said in my other reviews, please think about the maintainability of these tests. These tests are going to become extremely cryptic to read.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, missed that...just added now

@hbagdi
Copy link
Member

hbagdi commented Jul 27, 2022

Please merge after fixing the one comment.

@GGabriele GGabriele dismissed stale reviews from tjasko and mikefero via 4512ef8 July 27, 2022 18:56
@GGabriele GGabriele merged commit 2b18669 into main Jul 27, 2022
@GGabriele GGabriele deleted the feat/aws-lambda-vc branch July 27, 2022 19:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants