Skip to content
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-6945 - Replace usage of deprecated Envoy field envoy.config.core.v3.HeaderValueOption.append #20078

Merged
merged 5 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/20078.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
connect: Replace usage of deprecated Envoy field `envoy.config.core.v3.HeaderValueOption.append`.
```
6 changes: 5 additions & 1 deletion agent/xds/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,10 @@ func makeHeadersValueOptions(vals map[string]string, add bool) []*envoy_core_v3.
Key: k,
Value: v,
},
Append: response.MakeBoolValue(add),
}
if !add {
// default is APPEND_IF_EXISTS_OR_ADD
o.AppendAction = envoy_core_v3.HeaderValueOption_OVERWRITE_IF_EXISTS_OR_ADD
}
opts = append(opts, o)
}
Expand Down Expand Up @@ -1130,6 +1133,7 @@ func injectLBToRouteAction(lb *structs.LoadBalancer, action *envoy_route_v3.Rout
}

func injectHeaderManipToRoute(dest *structs.ServiceRouteDestination, r *envoy_route_v3.Route) error {

if !dest.RequestHeaders.IsZero() {
r.RequestHeadersToAdd = append(
r.RequestHeadersToAdd,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@
},
"requestHeadersToAdd": [
{
"append": true,
"header": {
"key": "X-Header-Add",
"value": "added"
}
},
{
"append": false,
"appendAction": "OVERWRITE_IF_EXISTS_OR_ADD",
"header": {
"key": "X-Header-Set",
"value": "set"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@
},
"requestHeadersToAdd": [
{
"append": true,
"header": {
"key": "X-Header-Add",
"value": "added"
}
},
{
"append": false,
"appendAction": "OVERWRITE_IF_EXISTS_OR_ADD",
"header": {
"key": "X-Header-Set",
"value": "set"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"name": "big-side.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul",
"requestHeadersToAdd": [
{
"append": false,
"appendAction": "OVERWRITE_IF_EXISTS_OR_ADD",
"header": {
"key": "x-split-leg",
"value": "big"
Expand All @@ -32,7 +32,7 @@
],
"responseHeadersToAdd": [
{
"append": false,
"appendAction": "OVERWRITE_IF_EXISTS_OR_ADD",
"header": {
"key": "x-split-leg",
"value": "big"
Expand All @@ -45,7 +45,7 @@
"name": "goldilocks-side.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul",
"requestHeadersToAdd": [
{
"append": false,
"appendAction": "OVERWRITE_IF_EXISTS_OR_ADD",
"header": {
"key": "x-split-leg",
"value": "goldilocks"
Expand All @@ -54,7 +54,7 @@
],
"responseHeadersToAdd": [
{
"append": false,
"appendAction": "OVERWRITE_IF_EXISTS_OR_ADD",
"header": {
"key": "x-split-leg",
"value": "goldilocks"
Expand All @@ -67,7 +67,7 @@
"name": "lil-bit-side.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul",
"requestHeadersToAdd": [
{
"append": false,
"appendAction": "OVERWRITE_IF_EXISTS_OR_ADD",
"header": {
"key": "x-split-leg",
"value": "small"
Expand All @@ -76,7 +76,7 @@
],
"responseHeadersToAdd": [
{
"append": false,
"appendAction": "OVERWRITE_IF_EXISTS_OR_ADD",
"header": {
"key": "x-split-leg",
"value": "small"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,14 +369,13 @@
},
"requestHeadersToAdd": [
{
"append": true,
"header": {
"key": "request",
"value": "bar"
}
},
{
"append": false,
"appendAction": "OVERWRITE_IF_EXISTS_OR_ADD",
"header": {
"key": "bar",
"value": "baz"
Expand All @@ -388,14 +387,13 @@
],
"responseHeadersToAdd": [
{
"append": true,
"header": {
"key": "response",
"value": "bar"
}
},
{
"append": false,
"appendAction": "OVERWRITE_IF_EXISTS_OR_ADD",
"header": {
"key": "bar",
"value": "baz"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"name": "db.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul",
"requestHeadersToAdd": [
{
"append": false,
"appendAction": "OVERWRITE_IF_EXISTS_OR_ADD",
"header": {
"key": "x-split-leg",
"value": "db"
Expand All @@ -50,7 +50,7 @@
],
"responseHeadersToAdd": [
{
"append": false,
"appendAction": "OVERWRITE_IF_EXISTS_OR_ADD",
"header": {
"key": "x-split-leg",
"value": "db"
Expand All @@ -63,7 +63,7 @@
"name": "big-side.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul",
"requestHeadersToAdd": [
{
"append": false,
"appendAction": "OVERWRITE_IF_EXISTS_OR_ADD",
"header": {
"key": "x-split-leg",
"value": "big"
Expand All @@ -72,7 +72,7 @@
],
"responseHeadersToAdd": [
{
"append": false,
"appendAction": "OVERWRITE_IF_EXISTS_OR_ADD",
"header": {
"key": "x-split-leg",
"value": "big"
Expand All @@ -85,7 +85,7 @@
"name": "goldilocks-side.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul",
"requestHeadersToAdd": [
{
"append": false,
"appendAction": "OVERWRITE_IF_EXISTS_OR_ADD",
"header": {
"key": "x-split-leg",
"value": "goldilocks"
Expand All @@ -94,7 +94,7 @@
],
"responseHeadersToAdd": [
{
"append": false,
"appendAction": "OVERWRITE_IF_EXISTS_OR_ADD",
"header": {
"key": "x-split-leg",
"value": "goldilocks"
Expand All @@ -107,7 +107,7 @@
"name": "lil-bit-side.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul",
"requestHeadersToAdd": [
{
"append": false,
"appendAction": "OVERWRITE_IF_EXISTS_OR_ADD",
"header": {
"key": "x-split-leg",
"value": "small"
Expand All @@ -116,7 +116,7 @@
],
"responseHeadersToAdd": [
{
"append": false,
"appendAction": "OVERWRITE_IF_EXISTS_OR_ADD",
"header": {
"key": "x-split-leg",
"value": "small"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@
"name": "db",
"requestHeadersToAdd": [
{
"append": true,
"header": {
"key": "foo",
"value": "bar"
}
},
{
"append": false,
"appendAction": "OVERWRITE_IF_EXISTS_OR_ADD",
"header": {
"key": "bar",
"value": "baz"
Expand All @@ -33,14 +32,13 @@
],
"responseHeadersToAdd": [
{
"append": true,
"header": {
"key": "foo",
"value": "bar"
}
},
{
"append": false,
"appendAction": "OVERWRITE_IF_EXISTS_OR_ADD",
"header": {
"key": "bar",
"value": "baz"
Expand Down Expand Up @@ -408,14 +406,13 @@
},
"requestHeadersToAdd": [
{
"append": true,
"header": {
"key": "request",
"value": "bar"
}
},
{
"append": false,
"appendAction": "OVERWRITE_IF_EXISTS_OR_ADD",
"header": {
"key": "bar",
"value": "baz"
Expand All @@ -427,14 +424,13 @@
],
"responseHeadersToAdd": [
{
"append": true,
"header": {
"key": "response",
"value": "bar"
}
},
{
"append": false,
"appendAction": "OVERWRITE_IF_EXISTS_OR_ADD",
"header": {
"key": "bar",
"value": "baz"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,14 +370,13 @@
},
"requestHeadersToAdd": [
{
"append": true,
"header": {
"key": "request",
"value": "bar"
}
},
{
"append": false,
"appendAction": "OVERWRITE_IF_EXISTS_OR_ADD",
"header": {
"key": "bar",
"value": "baz"
Expand All @@ -389,14 +388,13 @@
],
"responseHeadersToAdd": [
{
"append": true,
"header": {
"key": "response",
"value": "bar"
}
},
{
"append": false,
"appendAction": "OVERWRITE_IF_EXISTS_OR_ADD",
"header": {
"key": "bar",
"value": "baz"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"name": "db.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul",
"requestHeadersToAdd": [
{
"append": false,
"appendAction": "OVERWRITE_IF_EXISTS_OR_ADD",
"header": {
"key": "x-split-leg",
"value": "db"
Expand All @@ -51,7 +51,7 @@
],
"responseHeadersToAdd": [
{
"append": false,
"appendAction": "OVERWRITE_IF_EXISTS_OR_ADD",
"header": {
"key": "x-split-leg",
"value": "db"
Expand All @@ -64,7 +64,7 @@
"name": "big-side.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul",
"requestHeadersToAdd": [
{
"append": false,
"appendAction": "OVERWRITE_IF_EXISTS_OR_ADD",
"header": {
"key": "x-split-leg",
"value": "big"
Expand All @@ -73,7 +73,7 @@
],
"responseHeadersToAdd": [
{
"append": false,
"appendAction": "OVERWRITE_IF_EXISTS_OR_ADD",
"header": {
"key": "x-split-leg",
"value": "big"
Expand All @@ -86,7 +86,7 @@
"name": "goldilocks-side.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul",
"requestHeadersToAdd": [
{
"append": false,
"appendAction": "OVERWRITE_IF_EXISTS_OR_ADD",
"header": {
"key": "x-split-leg",
"value": "goldilocks"
Expand All @@ -95,7 +95,7 @@
],
"responseHeadersToAdd": [
{
"append": false,
"appendAction": "OVERWRITE_IF_EXISTS_OR_ADD",
"header": {
"key": "x-split-leg",
"value": "goldilocks"
Expand All @@ -108,7 +108,7 @@
"name": "lil-bit-side.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul",
"requestHeadersToAdd": [
{
"append": false,
"appendAction": "OVERWRITE_IF_EXISTS_OR_ADD",
"header": {
"key": "x-split-leg",
"value": "small"
Expand All @@ -117,7 +117,7 @@
],
"responseHeadersToAdd": [
{
"append": false,
"appendAction": "OVERWRITE_IF_EXISTS_OR_ADD",
"header": {
"key": "x-split-leg",
"value": "small"
Expand Down
Loading