docs: fix incorrect proxy-defaults config in Lua Envoy extension (#18418)

fix incorrect proxy-defaults config
pull/18437/head
Gerard Nguyen 1 year ago committed by GitHub
parent bb1a288b74
commit 10f69d86d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -42,15 +42,17 @@ The following example configures the Lua Envoy extension on every service by usi
<CodeBlockConfig filename="lua-envoy-extension-proxy-defaults.hcl"> <CodeBlockConfig filename="lua-envoy-extension-proxy-defaults.hcl">
```hcl ```hcl
Kind = "proxy-defaults" Kind = "proxy-defaults"
Name = "global" Name = "global"
Protocol = "http" Config {
protocol = "http"
}
EnvoyExtensions { EnvoyExtensions {
Name = "builtin/lua" Name = "builtin/lua"
Arguments = { Arguments = {
ProxyType = "connect-proxy" ProxyType = "connect-proxy"
Listener = "inbound" Listener = "inbound"
Script = <<-EOS Script = <<-EOF
function envoy_on_request(request_handle) function envoy_on_request(request_handle)
meta = request_handle:streamInfo():dynamicMetadata() meta = request_handle:streamInfo():dynamicMetadata()
m = meta:get("consul") m = meta:get("consul")
@ -59,7 +61,7 @@ function envoy_on_request(request_handle)
request_handle:headers():add("x-consul-datacenter", m["datacenter"]) request_handle:headers():add("x-consul-datacenter", m["datacenter"])
request_handle:headers():add("x-consul-trust-domain", m["trust-domain"]) request_handle:headers():add("x-consul-trust-domain", m["trust-domain"])
end end
EOS EOF
} }
} }
``` ```

Loading…
Cancel
Save