-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NET-5531 Translate response header modifier(s) from HTTPRoute onto Consul config entry #2904
Conversation
1ea3771
to
c92e491
Compare
@@ -2,7 +2,10 @@ module github.com/hashicorp/consul-k8s/control-plane | |||
|
|||
// TODO: remove when the SDK is released for Consul 1.17 | |||
// The replace directive is needed be because `api` requires 0.14.1 of SDK and is both a direct and indirect dependency | |||
replace github.com/hashicorp/consul/sdk v0.14.1 => github.com/hashicorp/consul/sdk v0.4.1-0.20230825164720-ecdcde430924 | |||
replace ( | |||
github.com/hashicorp/consul/proto-public v0.4.1 => github.com/hashicorp/consul/proto-public v0.1.2-0.20230911164019-a69e901660bd |
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.
is there a reason why we're adding a new replace here? if it's to work with an unreleased version should we update this comment as well?
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 just added a comment explaining the replace directive that I added as well as making the TODO more robust
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.
few minor questions but overall LGTM
Also use same pin for `sdk` that we're using for `api` and `proto-public`
Changes proposed in this PR:
Translate the
responseHeaderModifier
that already exists on the K8sHTTPRoute
onto thehttp-route
config entry in Consul, which accepts response header modifiers as of hashicorp/consul#18646.This PR also addresses the fact that we write an empty header modifier to Consul today for request header modifications when the K8s
HTTPRoute
does not specify any header modifications. Instead, we now appropriately write an empty list of header modifications to Consul when theHTTPRoute
does not specify any.How I've tested this PR:
Create a K8s
HTTPRoute
with various response header modifier filter(s) and verify that the filter syncs into Consul and functions correctly. See video of my own testing.In addition, conformance tests exist here for this functionality that should pass where they previously failed. Here is the output of those tests passing.
How I expect reviewers to test this PR:
See above
Checklist: