lua support cluster specifier extension (#31034)

* lua cluster specifier api

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

* fix api format

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

* add validate for api filed

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

* fix api format

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

* implement lua cluster specifier plugin

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

* fix format

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

* fix format

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

* fix format

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

* add example

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

* fix format

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

* fix format

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

* fix example

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

* fix review

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

* fix dep ci

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

* add changelog

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

* fix review

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

* fix ut

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

* add test

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

---------

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

Mirrored from https://github.com/envoyproxy/envoy @ 57f23d3092956972f2c23f869280310c7a65ca33
main
update-envoy[bot] 11 months ago
parent e17c813c1b
commit 5d0dac990e
  1. 1
      BUILD
  2. 12
      envoy/extensions/router/cluster_specifiers/lua/v3/BUILD
  3. 27
      envoy/extensions/router/cluster_specifiers/lua/v3/lua.proto
  4. 1
      versioning/BUILD

@ -309,6 +309,7 @@ proto_library(
"//envoy/extensions/retry/host/omit_host_metadata/v3:pkg",
"//envoy/extensions/retry/host/previous_hosts/v3:pkg",
"//envoy/extensions/retry/priority/previous_priorities/v3:pkg",
"//envoy/extensions/router/cluster_specifiers/lua/v3:pkg",
"//envoy/extensions/stat_sinks/graphite_statsd/v3:pkg",
"//envoy/extensions/stat_sinks/open_telemetry/v3:pkg",
"//envoy/extensions/stat_sinks/wasm/v3:pkg",

@ -0,0 +1,12 @@
# DO NOT EDIT. This file is generated by tools/proto_format/proto_sync.py.
load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package")
licenses(["notice"]) # Apache 2
api_proto_package(
deps = [
"//envoy/config/core/v3:pkg",
"@com_github_cncf_xds//udpa/annotations:pkg",
],
)

@ -0,0 +1,27 @@
syntax = "proto3";
package envoy.extensions.router.cluster_specifiers.lua.v3;
import "envoy/config/core/v3/base.proto";
import "udpa/annotations/status.proto";
import "validate/validate.proto";
option java_package = "io.envoyproxy.envoy.extensions.router.cluster_specifiers.lua.v3";
option java_outer_classname = "LuaProto";
option java_multiple_files = true;
option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/router/cluster_specifiers/lua/v3;luav3";
option (udpa.annotations.file_status).package_version_status = ACTIVE;
// [#protodoc-title: Lua]
//
// Lua cluster specifier :ref:`configuration reference documentation <config_http_cluster_specifier_lua>`.
// [#extension: envoy.router.cluster_specifier_plugin.lua]
message LuaConfig {
// The lua code that Envoy will execute to select cluster.
config.core.v3.DataSource source_code = 1 [(validate.rules).message = {required: true}];
// Default cluster. It will be used when the lua code execute failure.
string default_cluster = 2;
}

@ -248,6 +248,7 @@ proto_library(
"//envoy/extensions/retry/host/omit_host_metadata/v3:pkg",
"//envoy/extensions/retry/host/previous_hosts/v3:pkg",
"//envoy/extensions/retry/priority/previous_priorities/v3:pkg",
"//envoy/extensions/router/cluster_specifiers/lua/v3:pkg",
"//envoy/extensions/stat_sinks/graphite_statsd/v3:pkg",
"//envoy/extensions/stat_sinks/open_telemetry/v3:pkg",
"//envoy/extensions/stat_sinks/wasm/v3:pkg",

Loading…
Cancel
Save