lua: deprecate inline_code and use default_source_code (#22125)

Signed-off-by: wbpcode <wangbaiping@corp.netease.com>

Mirrored from https://github.com/envoyproxy/envoy @ de3579735584f3d7db9470f023eb7775f8fb8ffb
pull/626/head
data-plane-api(Azure Pipelines) 2 years ago
parent 8929c1310b
commit bcb9cea72e
  1. 1
      envoy/extensions/filters/http/lua/v3/BUILD
  2. 14
      envoy/extensions/filters/http/lua/v3/lua.proto

@ -6,6 +6,7 @@ licenses(["notice"]) # Apache 2
api_proto_package(
deps = [
"//envoy/annotations:pkg",
"//envoy/config/core/v3:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],

@ -4,6 +4,7 @@ package envoy.extensions.filters.http.lua.v3;
import "envoy/config/core/v3/base.proto";
import "envoy/annotations/deprecation.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
@ -26,7 +27,14 @@ message Lua {
// further loads code from disk if desired. Note that if JSON configuration is used, the code must
// be properly escaped. YAML configuration may be easier to read since YAML supports multi-line
// strings so complex scripts can be easily expressed inline in the configuration.
string inline_code = 1 [(validate.rules).string = {min_len: 1}];
//
// This field is deprecated. Please use
// :ref:`default_source_code <envoy_v3_api_field_extensions.filters.http.lua.v3.Lua.default_source_code>`.
// Only one of :ref:`inline_code <envoy_v3_api_field_extensions.filters.http.lua.v3.Lua.inline_code>`
// or :ref:`default_source_code <envoy_v3_api_field_extensions.filters.http.lua.v3.Lua.default_source_code>`
// can be set for the Lua filter.
string inline_code = 1
[deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"];
// Map of named Lua source codes that can be referenced in :ref:`LuaPerRoute
// <envoy_v3_api_msg_extensions.filters.http.lua.v3.LuaPerRoute>`. The Lua source codes can be
@ -46,6 +54,10 @@ message Lua {
// filename: /etc/lua/world.lua
//
map<string, config.core.v3.DataSource> source_codes = 2;
// The default Lua code that Envoy will execute. If no per route config is provided
// for the request, this Lua code will be applied.
config.core.v3.DataSource default_source_code = 3;
}
message LuaPerRoute {

Loading…
Cancel
Save