Skip to content

Commit

Permalink
NET-6944 - Replace usage of deprecated Envoy field envoy.extensions.f…
Browse files Browse the repository at this point in the history
…ilters.http.lua.v3.Lua.inline_code (#20012)
  • Loading branch information
jmurret committed Dec 22, 2023
1 parent 44b8470 commit 5b4133f
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .changelog/20012.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
xds: replace usage of deprecated Envoy field `envoy.extensions.filters.http.lua.v3.Lua.inline_code`
```
7 changes: 6 additions & 1 deletion agent/envoyextensions/builtin/lua/lua.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package lua
import (
"errors"
"fmt"
envoy_core_v3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"

envoy_listener_v3 "github.com/envoyproxy/go-control-plane/envoy/config/listener/v3"
envoy_lua_v3 "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/lua/v3"
Expand Down Expand Up @@ -97,7 +98,11 @@ func (l *lua) PatchFilter(p extensioncommon.FilterPayload) (*envoy_listener_v3.F
luaHttpFilter, err := extensioncommon.MakeEnvoyHTTPFilter(
"envoy.filters.http.lua",
&envoy_lua_v3.Lua{
InlineCode: l.Script,
DefaultSourceCode: &envoy_core_v3.DataSource{
Specifier: &envoy_core_v3.DataSource_InlineString{
InlineString: l.Script,
},
},
},
)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,9 @@
"name": "envoy.filters.http.lua",
"typedConfig": {
"@type": "type.googleapis.com/envoy.extensions.filters.http.lua.v3.Lua",
"inlineCode": "\nfunction envoy_on_request(request_handle)\n request_handle:headers():add(\"test\", \"test\")\nend"
"defaultSourceCode": {
"inlineString": "\nfunction envoy_on_request(request_handle)\n request_handle:headers():add(\"test\", \"test\")\nend"
}
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,9 @@
"name": "envoy.filters.http.lua",
"typedConfig": {
"@type": "type.googleapis.com/envoy.extensions.filters.http.lua.v3.Lua",
"inlineCode": "\nfunction envoy_on_request(request_handle)\n request_handle:headers():add(\"test\", \"test\")\nend"
"defaultSourceCode": {
"inlineString": "\nfunction envoy_on_request(request_handle)\n request_handle:headers():add(\"test\", \"test\")\nend"
}
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,9 @@
"name": "envoy.filters.http.lua",
"typedConfig": {
"@type": "type.googleapis.com/envoy.extensions.filters.http.lua.v3.Lua",
"inlineCode": "\nfunction envoy_on_request(request_handle)\n request_handle:headers():add(\"test\", \"test\")\nend"
"defaultSourceCode": {
"inlineString": "\nfunction envoy_on_request(request_handle)\n request_handle:headers():add(\"test\", \"test\")\nend"
}
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@
"name": "envoy.filters.http.lua",
"typedConfig": {
"@type": "type.googleapis.com/envoy.extensions.filters.http.lua.v3.Lua",
"inlineCode": "\nfunction envoy_on_request(request_handle)\n request_handle:headers():add(\"test\", \"test\")\nend"
"defaultSourceCode": {
"inlineString": "\nfunction envoy_on_request(request_handle)\n request_handle:headers():add(\"test\", \"test\")\nend"
}
}
},
{
Expand Down Expand Up @@ -102,7 +104,9 @@
"name": "envoy.filters.http.lua",
"typedConfig": {
"@type": "type.googleapis.com/envoy.extensions.filters.http.lua.v3.Lua",
"inlineCode": "\nfunction envoy_on_request(request_handle)\n request_handle:headers():add(\"test\", \"test\")\nend"
"defaultSourceCode": {
"inlineString": "\nfunction envoy_on_request(request_handle)\n request_handle:headers():add(\"test\", \"test\")\nend"
}
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
"name": "envoy.filters.http.lua",
"typedConfig": {
"@type": "type.googleapis.com/envoy.extensions.filters.http.lua.v3.Lua",
"inlineCode": "\nfunction envoy_on_request(request_handle)\n request_handle:headers():add(\"test\", \"test\")\nend"
"defaultSourceCode": {
"inlineString": "\nfunction envoy_on_request(request_handle)\n request_handle:headers():add(\"test\", \"test\")\nend"
}
}
},
{
Expand Down

0 comments on commit 5b4133f

Please sign in to comment.