-
Notifications
You must be signed in to change notification settings - Fork 4
feat: version compatibility for aws-lambda mutually-exclusive fields #313
Conversation
bae5b32
to
16760cd
Compare
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.
16760cd
to
5a2d8e8
Compare
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// 'aws_region' and 'host' used to be mutually exclusive fields but | |
// 'aws_region' and 'host' were mutually exclusive fields until Kong version 2.8 |
The approach isn't ideal but it does seem reasonable to me. |
@hbagdi are we good with this or you want to discuss this further? |
@@ -70,6 +70,7 @@ func TestVersionCompatibility(t *testing.T) { | |||
id: uuid.NewString(), | |||
config: `{ | |||
"aws_region": "AWS_REGION", | |||
"host": "192.168.1.1", |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
Please merge after fixing the one comment. |
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.