-
Notifications
You must be signed in to change notification settings - Fork 4
Conversation
@@ -75,6 +75,7 @@ var ( | |||
"connect_timeout", | |||
"send_timeout", | |||
"read_timeout", | |||
"http_response_header_for_traceid", |
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.
This is for 3.1 not 3.0; it will need to be defined in its own 3.1 version compatibility instance.
internal/test/e2e/plugins.go
Outdated
@@ -405,7 +405,8 @@ var VersionCompatibilityOSSPluginConfigurationTests = []VersionCompatibilityPlug | |||
// | |||
// DP < 3.0: | |||
// - remove 'http_span_name', 'connect_timeout' | |||
// 'send_timeout', 'read_timeout' | |||
// 'send_timeout', 'read_timeout', | |||
// 'http_response_header_for_traceid' |
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.
Same call out here for the test. We should also create a test to ensure that this field (and eventually others) are going down to a 3.1 data plane which is currently kong/kong:master-alpine executed during the integration GitHub Action.
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.
We should also create a test to ensure that this field (and eventually others) are going down to a 3.1 data plane
What does this mean? I provide an image tag when testing locally so I am hitting 3.1. Are you saying I also need to make a change to the CICD configuration? Or do I need to add something to the test suite like a unit test that specifically checks for an expected post-processing configuration for zipkin for DPs < 3.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.
kong/kong:master-alpine
is versioned 3.1.0
, so the CI is already testing the current status of the 3.1 release. We could probably add a test similar to where we use versions300AndAbove
and make sure new fields are not altered by the compatibility stuff (so going down to a 3.1+ DP).
@mikefero feel free to add more details in case I misunderstood this.
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.
Yep, that is exactly what I was referring to. Since this is for a new version of the Kong Gateway we want to ensure that this new field is being sent in the payload to these newer data planes. Validating these new releases is critical.
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.
I've changed the logic to require the field for versions 3.1^ instead of removing the field for versions pre-3.1 7f84e48.
In the absence of documentation on the field, I'm assuming we always want to set the value to X-B3-TraceId
based on the preceding work..
The reason I went with "remove for versions below 3.1" instead of "ensure presence for 3.1 and above" is because this field is not required. Also, this probably should be a warning instead of an error, no?
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.
@omegabytes , sorry, but I think there are some misunderstandings with the latest changes. Let me try to clarify:
-
The value of
http_response_header_for_traceid
can be set to anything the user want. This line you pointed is only based on a test value, which is a simple plugin configuration. -
There is no
absence of documentation
, it is just not done yet. The gateway documentation is often done only 1-2 weeks before GA, depending on the workload. -
We need a ChangeMetadata + test to ensure that if a user configure the zipkin plugin with that field, it is removed for older DPs. At the moment, this is probably crashing (errors at config push in DP logs). This was OK in your previous version IIRC.
-
We want a test to ensure that if a user configure the zipkin plugin with that field, the plugin configuration is not altered by the version compatibility translator. It should not with your previous version, so it is just a sanity check that new fields of the schema for a version are correctly going down for the new 3.1 release. So that is exactly this (if the plugin in test was configured with that field value)
Integration Tests [OSS] / integration (kong/kong:master-alpine, false) (pull_request) failing is a known issue |
@@ -211,7 +211,7 @@ func TestVersionCompatibility_PluginFieldUpdates(t *testing.T) { | |||
for _, plugin := range expectedPluginsMap { | |||
var config structpb.Struct | |||
if len(plugin.Config) > 0 { | |||
require.NoError(t, json.ProtoJSONUnmarshal([]byte(plugin.Config), &config)) | |||
require.NoError(t, json.ProtoJSONUnmarshal([]byte(plugin.Config), &config), plugin) |
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.
Adding this to the test fail message output helps isolate where an issue is. For example, I had a trailing comma, so the fail output was:
Error: Received unexpected error:
invalid character '}' looking for beginning of object key string
Test: TestVersionCompatibility_PluginFieldUpdates
Messages: {Name:zipkin Config:{
"local_service_name": "LOCAL_SERVICE_NAME",
"header_type": "ignore",
"http_span_name": "method_path",
"connect_timeout": 2001,
"send_timeout": 2001,
"read_timeout": 2001,
} Protocols:[] VersionRange: FieldUpdateChecks:map[< 2.7.0:[{Field:header_type Value:preserve}] >= 3.1.0:[{Field:http_response_header_for_traceid Value:X-B3-TraceId}]] ConfigureForService:true ConfigureForRoute:true ExpectedConfig:}
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.
Nice one!
"in Kong Gateway versions >= 3.1. " + | ||
"The plugin configuration has been updated to use " + | ||
"'config.http_response_header_for_traceid' in the data-plane.", | ||
Resolution: "Please update the configuration to use " + |
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.
I'm confused. Shouldn't we make sure that a new field is removed from payloads destined to older DPs? This rule is making sure that http_response_header_for_traceid
is set to X-B3-TraceId
for newer DPs, but I think this should actually make sure to remove it for pre-3.1 DPs, basically a copy&paste of this rule for the specific new config field.
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.
0d3d1d8
to
bab9dbc
Compare
internal/test/e2e/plugins.go
Outdated
@@ -423,6 +426,12 @@ var VersionCompatibilityOSSPluginConfigurationTests = []VersionCompatibilityPlug | |||
Value: "preserve", | |||
}, | |||
}, | |||
">= 3.1.0": { |
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.
Technically, this is not an update: the version compatibility rule is to remove this http_response_header_for_traceid
field from older DPs.
Adding things like this here to verify newer fields are present for newer DPs is not something we have been doing (for example, note that this is not checking that read_timeout
or send_timeout
are present for >=3.0.0
.
I think we should remove this, and maybe add a new test making sure new fields are present for 3.1.0.
Thoughts?
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.
+1, good point. Let's test this case only when it's a 3.1.0
DP. That way, we will also avoid modifying it if anything change in 3.2.0+. @omegabytes Note that we also want a test to check if that field is removed for <3.1 DPs.
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.
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.
1869fc3 asserts a valid config for 310 or newer. Includes some new fields as of 300 as well.
|
Adds
http_response_header_for_traceid
for zipkin.See Kong/kong#9173