Migrate `conduit-proxy` to `linkerd2-proxy`
The proxy now honors environment variables starting with `LINKERD2_PROXY_`.
This commit is contained in:
parent
ec303942ee
commit
c23ecd0cbc
|
@ -0,0 +1 @@
|
|||
Cargo.lock linguist-generated=false
|
|
@ -0,0 +1 @@
|
|||
target
|
|
@ -1,4 +1,4 @@
|
|||
# Contributing to Conduit #
|
||||
# Contributing to Linkerd2 #
|
||||
|
||||
:balloon: Thanks for your help improving the project!
|
||||
|
||||
|
@ -98,6 +98,6 @@ Describe the testing you've done to validate your change. Performance-related
|
|||
changes should include before- and after- benchmark results.
|
||||
|
||||
[discourse]: https://discourse.linkerd.io/c/conduit
|
||||
[issue]: https://github.com/runconduit/conduit/issues/new
|
||||
[members]: https://github.com/orgs/runconduit/people
|
||||
[issue]: https://github.com/linkerd/linkerd2/issues/new
|
||||
[members]: https://github.com/orgs/linkerd/people
|
||||
[slack]: http://slack.linkerd.io/
|
||||
|
|
170
Cargo.lock
170
Cargo.lock
|
@ -118,86 +118,6 @@ dependencies = [
|
|||
"indexmap 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "conduit-proxy"
|
||||
version = "0.3.0"
|
||||
dependencies = [
|
||||
"bytes 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"conduit-proxy-controller-grpc 0.3.0",
|
||||
"conduit-proxy-router 0.3.0",
|
||||
"deflate 0.7.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"env_logger 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"flate2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"futures-mpsc-lossy 0.3.0",
|
||||
"futures-watch 0.1.0 (git+https://github.com/carllerche/better-future)",
|
||||
"h2 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"http 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"httparse 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hyper 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"indexmap 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"inotify 0.5.2-dev (git+https://github.com/hawkw/inotify?branch=eliza/mio)",
|
||||
"ipnet 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"net2 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"procinfo 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"prost 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"prost-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"quickcheck 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"regex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ring 0.13.0-alpha5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustls 0.12.0 (git+https://github.com/ctz/rustls)",
|
||||
"tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tokio 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tokio-connect 0.1.0 (git+https://github.com/carllerche/tokio-connect)",
|
||||
"tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tokio-rustls 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tokio-signal 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tokio-timer 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tower-balance 0.1.0 (git+https://github.com/tower-rs/tower)",
|
||||
"tower-buffer 0.1.0 (git+https://github.com/tower-rs/tower)",
|
||||
"tower-discover 0.1.0 (git+https://github.com/tower-rs/tower)",
|
||||
"tower-grpc 0.1.0 (git+https://github.com/tower-rs/tower-grpc)",
|
||||
"tower-h2 0.1.0 (git+https://github.com/tower-rs/tower-h2)",
|
||||
"tower-h2-balance 0.1.0 (git+https://github.com/tower-rs/tower-h2)",
|
||||
"tower-in-flight-limit 0.1.0 (git+https://github.com/tower-rs/tower)",
|
||||
"tower-reconnect 0.1.0 (git+https://github.com/tower-rs/tower)",
|
||||
"tower-service 0.1.0 (git+https://github.com/tower-rs/tower)",
|
||||
"tower-util 0.1.0 (git+https://github.com/tower-rs/tower)",
|
||||
"trust-dns-resolver 0.9.0 (git+https://github.com/bluejekyll/trust-dns)",
|
||||
"try-lock 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"webpki 0.18.0-alpha4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "conduit-proxy-controller-grpc"
|
||||
version = "0.3.0"
|
||||
dependencies = [
|
||||
"bytes 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"h2 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"http 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"prost 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"prost-derive 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"prost-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"quickcheck 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tower-grpc 0.1.0 (git+https://github.com/tower-rs/tower-grpc)",
|
||||
"tower-grpc-build 0.1.0 (git+https://github.com/tower-rs/tower-grpc)",
|
||||
"tower-h2 0.1.0 (git+https://github.com/tower-rs/tower-h2)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "conduit-proxy-router"
|
||||
version = "0.3.0"
|
||||
dependencies = [
|
||||
"futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"indexmap 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tower-service 0.1.0 (git+https://github.com/tower-rs/tower)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crc"
|
||||
version = "1.7.0"
|
||||
|
@ -346,7 +266,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "futures-mpsc-lossy"
|
||||
version = "0.3.0"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
@ -548,6 +468,87 @@ name = "linked-hash-map"
|
|||
version = "0.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "linkerd2-proxy"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bytes 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"deflate 0.7.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"env_logger 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"flate2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"futures-mpsc-lossy 0.1.0",
|
||||
"futures-watch 0.1.0 (git+https://github.com/carllerche/better-future)",
|
||||
"h2 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"http 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"httparse 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hyper 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"indexmap 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"inotify 0.5.2-dev (git+https://github.com/hawkw/inotify?branch=eliza/mio)",
|
||||
"ipnet 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"linkerd2-proxy-api 0.1.0 (git+https://github.com/linkerd/linkerd2-proxy-api)",
|
||||
"linkerd2-proxy-router 0.1.0",
|
||||
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"net2 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"procinfo 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"prost 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"prost-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"quickcheck 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"regex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ring 0.13.0-alpha5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustls 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tokio 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tokio-connect 0.1.0 (git+https://github.com/carllerche/tokio-connect)",
|
||||
"tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tokio-rustls 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tokio-signal 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tokio-timer 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tower-balance 0.1.0 (git+https://github.com/tower-rs/tower)",
|
||||
"tower-buffer 0.1.0 (git+https://github.com/tower-rs/tower)",
|
||||
"tower-discover 0.1.0 (git+https://github.com/tower-rs/tower)",
|
||||
"tower-grpc 0.1.0 (git+https://github.com/tower-rs/tower-grpc)",
|
||||
"tower-h2 0.1.0 (git+https://github.com/tower-rs/tower-h2)",
|
||||
"tower-h2-balance 0.1.0 (git+https://github.com/tower-rs/tower-h2)",
|
||||
"tower-in-flight-limit 0.1.0 (git+https://github.com/tower-rs/tower)",
|
||||
"tower-reconnect 0.1.0 (git+https://github.com/tower-rs/tower)",
|
||||
"tower-service 0.1.0 (git+https://github.com/tower-rs/tower)",
|
||||
"tower-util 0.1.0 (git+https://github.com/tower-rs/tower)",
|
||||
"trust-dns-resolver 0.9.0 (git+https://github.com/bluejekyll/trust-dns)",
|
||||
"try-lock 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"webpki 0.18.0-alpha4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "linkerd2-proxy-api"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/linkerd/linkerd2-proxy-api#a245facbbeb6b5533818caf233983253caf1f397"
|
||||
dependencies = [
|
||||
"bytes 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"h2 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"http 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"prost 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"prost-derive 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"prost-types 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"quickcheck 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tower-grpc 0.1.0 (git+https://github.com/tower-rs/tower-grpc)",
|
||||
"tower-grpc-build 0.1.0 (git+https://github.com/tower-rs/tower-grpc)",
|
||||
"tower-h2 0.1.0 (git+https://github.com/tower-rs/tower-h2)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "linkerd2-proxy-router"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"indexmap 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tower-service 0.1.0 (git+https://github.com/tower-rs/tower)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "log"
|
||||
version = "0.4.1"
|
||||
|
@ -924,7 +925,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "rustls"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/ctz/rustls#8a78639c7f670e5440ecfe5053c1809290245b59"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"base64 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -1146,7 +1147,7 @@ name = "tokio-rustls"
|
|||
version = "0.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"rustls 0.12.0 (git+https://github.com/ctz/rustls)",
|
||||
"rustls 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tokio 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"webpki 0.18.0-alpha4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
@ -1599,6 +1600,7 @@ dependencies = [
|
|||
"checksum lazycell 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a6f08839bc70ef4a3fe1d566d5350f519c5912ea86be0df1740a7d247c7fc0ef"
|
||||
"checksum libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)" = "6fd41f331ac7c5b8ac259b8bf82c75c0fb2e469bbf37d2becbba9a6a2221965b"
|
||||
"checksum linked-hash-map 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7860ec297f7008ff7a1e3382d7f7e1dcd69efc94751a2284bafc3d013c2aa939"
|
||||
"checksum linkerd2-proxy-api 0.1.0 (git+https://github.com/linkerd/linkerd2-proxy-api)" = "<none>"
|
||||
"checksum log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "89f010e843f2b1a31dbd316b3b8d443758bc634bed37aabade59c686d644e0a2"
|
||||
"checksum lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4d06ff7ff06f729ce5f4e227876cb88d10bc59cd4ae1e09fbb2bde15c850dc21"
|
||||
"checksum matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "100aabe6b8ff4e4a7e32c1c13523379802df0772b82466207ac25b013f193376"
|
||||
|
@ -1643,7 +1645,7 @@ dependencies = [
|
|||
"checksum ring 0.13.0-alpha5 (registry+https://github.com/rust-lang/crates.io-index)" = "3845516753f91b4511f9b17c917ea6fa4bc5a7853a9947b0f66731aff51cdef5"
|
||||
"checksum rustc-demangle 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "aee45432acc62f7b9a108cc054142dac51f979e69e71ddce7d6fc7adf29e817e"
|
||||
"checksum rustc_version 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a54aa04a10c68c1c4eacb4337fd883b435997ede17a9385784b990777686b09a"
|
||||
"checksum rustls 0.12.0 (git+https://github.com/ctz/rustls)" = "<none>"
|
||||
"checksum rustls 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ab72e4883a4fc9fd5cd462a51c55d79f6a7b5c9483e8d73a2b7bca0b18430bcd"
|
||||
"checksum safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e27a8b19b835f7aea908818e871f5cc3a5a186550c30773be987e155e8163d8f"
|
||||
"checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27"
|
||||
"checksum sct 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b4540aed8d71a5de961a8902cf356e28122bd62695eb5be1c214f84d8704097c"
|
||||
|
|
88
Cargo.toml
88
Cargo.toml
|
@ -1,10 +1,86 @@
|
|||
[workspace]
|
||||
members = [
|
||||
"proxy",
|
||||
"proxy/controller-grpc",
|
||||
"proxy/futures-mpsc-lossy",
|
||||
"proxy/router",
|
||||
".",
|
||||
"futures-mpsc-lossy",
|
||||
"router",
|
||||
]
|
||||
|
||||
[patch.crates-io]
|
||||
rustls = { git = "https://github.com/ctz/rustls" }
|
||||
[package]
|
||||
name = "linkerd2-proxy"
|
||||
version = "0.1.0"
|
||||
authors = ["Oliver Gould <ver@buoyant.io>"]
|
||||
publish = false
|
||||
|
||||
[features]
|
||||
default = ["flaky_tests"]
|
||||
# Disable to skip certain tests that should not be run on CI.
|
||||
flaky_tests = []
|
||||
|
||||
[dependencies]
|
||||
futures-mpsc-lossy = { path = "./futures-mpsc-lossy" }
|
||||
linkerd2-proxy-router = { path = "./router" }
|
||||
|
||||
linkerd2-proxy-api = { git = "https://github.com/linkerd/linkerd2-proxy-api" }
|
||||
|
||||
bytes = "0.4"
|
||||
deflate = {version = "0.7.18", features = ["gzip"] }
|
||||
env_logger = { version = "0.5", default-features = false }
|
||||
futures = "0.1"
|
||||
futures-watch = { git = "https://github.com/carllerche/better-future" }
|
||||
h2 = "0.1.10"
|
||||
http = "0.1"
|
||||
httparse = "1.2"
|
||||
hyper = "0.12.3"
|
||||
ipnet = "1.0"
|
||||
log = "0.4.1"
|
||||
indexmap = "1.0.0"
|
||||
prost = "0.4.0"
|
||||
prost-types = "0.4.0"
|
||||
rand = "0.5.1"
|
||||
try-lock = "0.2"
|
||||
|
||||
# for config parsing
|
||||
regex = "1.0.0"
|
||||
|
||||
# networking
|
||||
tokio = "0.1.7"
|
||||
tokio-signal = "0.2"
|
||||
tokio-timer = "0.2.4" # for tokio_timer::clock
|
||||
tokio-connect = { git = "https://github.com/carllerche/tokio-connect" }
|
||||
tower-balance = { git = "https://github.com/tower-rs/tower" }
|
||||
tower-buffer = { git = "https://github.com/tower-rs/tower" }
|
||||
tower-discover = { git = "https://github.com/tower-rs/tower" }
|
||||
tower-in-flight-limit = { git = "https://github.com/tower-rs/tower" }
|
||||
tower-reconnect = { git = "https://github.com/tower-rs/tower" }
|
||||
tower-service = { git = "https://github.com/tower-rs/tower" }
|
||||
tower-util = { git = "https://github.com/tower-rs/tower" }
|
||||
tower-h2 = { git = "https://github.com/tower-rs/tower-h2" }
|
||||
tower-h2-balance = { git = "https://github.com/tower-rs/tower-h2" }
|
||||
tower-grpc = { git = "https://github.com/tower-rs/tower-grpc" }
|
||||
|
||||
# dns
|
||||
trust-dns-resolver = { default-features = false, git = "https://github.com/bluejekyll/trust-dns" }
|
||||
|
||||
# tls
|
||||
ring = "0.13.0-alpha4"
|
||||
webpki = "0.18.0-alpha4"
|
||||
rustls = "0.12.0"
|
||||
tokio-rustls = "0.6.0"
|
||||
untrusted = "0.6.1"
|
||||
|
||||
[target.'cfg(target_os = "linux")'.dependencies]
|
||||
libc = "0.2"
|
||||
inotify = { git = "https://github.com/hawkw/inotify", branch = "eliza/mio" }
|
||||
procinfo = "0.4.2"
|
||||
|
||||
[dev-dependencies]
|
||||
net2 = "0.2"
|
||||
quickcheck = { version = "0.6", default-features = false }
|
||||
linkerd2-proxy-api = { git = "https://github.com/linkerd/linkerd2-proxy-api", features = ["arbitrary"] }
|
||||
flate2 = { version = "1.0.1", default-features = false, features = ["rust_backend"] }
|
||||
# `tokio-io` is needed for TCP tests, because `tokio::io` doesn't re-export
|
||||
# the `read` function.
|
||||
tokio-io = "0.1.6"
|
||||
# Used for filesystem watch tests. We should switch from `tempdir` to `tempfile` once
|
||||
# `prost-build` switches to it.`
|
||||
tempdir = "0.3"
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#![feature(test)]
|
||||
#![deny(warnings)]
|
||||
|
||||
extern crate conduit_proxy;
|
||||
extern crate linkerd2_proxy;
|
||||
extern crate http;
|
||||
extern crate test;
|
||||
|
||||
use conduit_proxy::{
|
||||
use linkerd2_proxy::{
|
||||
ctx,
|
||||
conditional::Conditional,
|
||||
control::destination,
|
||||
|
@ -22,7 +22,7 @@ use std::{
|
|||
time::{Duration, Instant},
|
||||
};
|
||||
use test::Bencher;
|
||||
use conduit_proxy::tls;
|
||||
use linkerd2_proxy::tls;
|
||||
|
||||
const REQUESTS: usize = 100;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "futures-mpsc-lossy"
|
||||
version = "0.3.0"
|
||||
version = "0.1.0"
|
||||
authors = ["Oliver Gould <ver@buoyant.io>"]
|
||||
publish = false
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
[package]
|
||||
name = "conduit-proxy"
|
||||
version = "0.3.0"
|
||||
authors = ["Oliver Gould <ver@buoyant.io>"]
|
||||
publish = false
|
||||
|
||||
[features]
|
||||
default = ["flaky_tests"]
|
||||
# Disable to skip certain tests that should not be run on CI.
|
||||
flaky_tests = []
|
||||
|
||||
[dependencies]
|
||||
conduit-proxy-controller-grpc = { path = "./controller-grpc" }
|
||||
futures-mpsc-lossy = { path = "./futures-mpsc-lossy" }
|
||||
conduit-proxy-router = { path = "./router" }
|
||||
|
||||
bytes = "0.4"
|
||||
deflate = {version = "0.7.18", features = ["gzip"] }
|
||||
env_logger = { version = "0.5", default-features = false }
|
||||
futures = "0.1"
|
||||
futures-watch = { git = "https://github.com/carllerche/better-future" }
|
||||
h2 = "0.1.10"
|
||||
http = "0.1"
|
||||
httparse = "1.2"
|
||||
hyper = "0.12.3"
|
||||
ipnet = "1.0"
|
||||
log = "0.4.1"
|
||||
indexmap = "1.0.0"
|
||||
prost = "0.4.0"
|
||||
prost-types = "0.4.0"
|
||||
rand = "0.5.1"
|
||||
try-lock = "0.2"
|
||||
|
||||
# for config parsing
|
||||
regex = "1.0.0"
|
||||
|
||||
# networking
|
||||
tokio = "0.1.7"
|
||||
tokio-signal = "0.2"
|
||||
tokio-timer = "0.2.4" # for tokio_timer::clock
|
||||
tokio-connect = { git = "https://github.com/carllerche/tokio-connect" }
|
||||
tower-balance = { git = "https://github.com/tower-rs/tower" }
|
||||
tower-buffer = { git = "https://github.com/tower-rs/tower" }
|
||||
tower-discover = { git = "https://github.com/tower-rs/tower" }
|
||||
tower-in-flight-limit = { git = "https://github.com/tower-rs/tower" }
|
||||
tower-reconnect = { git = "https://github.com/tower-rs/tower" }
|
||||
tower-service = { git = "https://github.com/tower-rs/tower" }
|
||||
tower-util = { git = "https://github.com/tower-rs/tower" }
|
||||
tower-h2 = { git = "https://github.com/tower-rs/tower-h2" }
|
||||
tower-h2-balance = { git = "https://github.com/tower-rs/tower-h2" }
|
||||
tower-grpc = { git = "https://github.com/tower-rs/tower-grpc" }
|
||||
|
||||
# dns
|
||||
trust-dns-resolver = { default-features = false, git = "https://github.com/bluejekyll/trust-dns" }
|
||||
|
||||
# tls
|
||||
ring = "0.13.0-alpha4"
|
||||
webpki = "0.18.0-alpha4"
|
||||
rustls = "0.12.0"
|
||||
tokio-rustls = "0.6.0"
|
||||
untrusted = "0.6.1"
|
||||
|
||||
[target.'cfg(target_os = "linux")'.dependencies]
|
||||
libc = "0.2"
|
||||
inotify = { git = "https://github.com/hawkw/inotify", branch = "eliza/mio" }
|
||||
procinfo = "0.4.2"
|
||||
|
||||
[dev-dependencies]
|
||||
net2 = "0.2"
|
||||
quickcheck = { version = "0.6", default-features = false }
|
||||
conduit-proxy-controller-grpc = { path = "./controller-grpc" , features = ["arbitrary"] }
|
||||
flate2 = { version = "1.0.1", default-features = false, features = ["rust_backend"] }
|
||||
# `tokio-io` is needed for TCP tests, because `tokio::io` doesn't re-export
|
||||
# the `read` function.
|
||||
tokio-io = "0.1.6"
|
||||
# Used for filesystem watch tests. We should switch from `tempdir` to `tempfile` once
|
||||
# `prost-build` switches to it.`
|
||||
tempdir = "0.3"
|
|
@ -1,7 +1,10 @@
|
|||
[package]
|
||||
name = "conduit-proxy-router"
|
||||
version = "0.3.0"
|
||||
authors = ["Carl Lerche <me@carllerche.com>"]
|
||||
name = "linkerd2-proxy-router"
|
||||
version = "0.1.0"
|
||||
authors = [
|
||||
"Oliver Gould <ver@buoyant.io>",
|
||||
"Carl Lerche <me@carllerche.com>",
|
||||
]
|
||||
publish = false
|
||||
|
||||
[dependencies]
|
|
@ -159,52 +159,52 @@ pub struct TestEnv {
|
|||
}
|
||||
|
||||
// Environment variables to look at when loading the configuration
|
||||
const ENV_EVENT_BUFFER_CAPACITY: &str = "CONDUIT_PROXY_EVENT_BUFFER_CAPACITY";
|
||||
pub const ENV_PRIVATE_LISTENER: &str = "CONDUIT_PROXY_PRIVATE_LISTENER";
|
||||
pub const ENV_PRIVATE_FORWARD: &str = "CONDUIT_PROXY_PRIVATE_FORWARD";
|
||||
pub const ENV_PUBLIC_LISTENER: &str = "CONDUIT_PROXY_PUBLIC_LISTENER";
|
||||
pub const ENV_CONTROL_LISTENER: &str = "CONDUIT_PROXY_CONTROL_LISTENER";
|
||||
pub const ENV_METRICS_LISTENER: &str = "CONDUIT_PROXY_METRICS_LISTENER";
|
||||
pub const ENV_METRICS_RETAIN_IDLE: &str = "CONDUIT_PROXY_METRICS_RETAIN_IDLE";
|
||||
const ENV_PRIVATE_CONNECT_TIMEOUT: &str = "CONDUIT_PROXY_PRIVATE_CONNECT_TIMEOUT";
|
||||
const ENV_PUBLIC_CONNECT_TIMEOUT: &str = "CONDUIT_PROXY_PUBLIC_CONNECT_TIMEOUT";
|
||||
pub const ENV_BIND_TIMEOUT: &str = "CONDUIT_PROXY_BIND_TIMEOUT";
|
||||
const ENV_EVENT_BUFFER_CAPACITY: &str = "LINKERD2_PROXY_EVENT_BUFFER_CAPACITY";
|
||||
pub const ENV_PRIVATE_LISTENER: &str = "LINKERD2_PROXY_PRIVATE_LISTENER";
|
||||
pub const ENV_PRIVATE_FORWARD: &str = "LINKERD2_PROXY_PRIVATE_FORWARD";
|
||||
pub const ENV_PUBLIC_LISTENER: &str = "LINKERD2_PROXY_PUBLIC_LISTENER";
|
||||
pub const ENV_CONTROL_LISTENER: &str = "LINKERD2_PROXY_CONTROL_LISTENER";
|
||||
pub const ENV_METRICS_LISTENER: &str = "LINKERD2_PROXY_METRICS_LISTENER";
|
||||
pub const ENV_METRICS_RETAIN_IDLE: &str = "LINKERD2_PROXY_METRICS_RETAIN_IDLE";
|
||||
const ENV_PRIVATE_CONNECT_TIMEOUT: &str = "LINKERD2_PROXY_PRIVATE_CONNECT_TIMEOUT";
|
||||
const ENV_PUBLIC_CONNECT_TIMEOUT: &str = "LINKERD2_PROXY_PUBLIC_CONNECT_TIMEOUT";
|
||||
pub const ENV_BIND_TIMEOUT: &str = "LINKERD2_PROXY_BIND_TIMEOUT";
|
||||
|
||||
// Limits the number of HTTP routes that may be active in the proxy at any time. There is
|
||||
// an inbound route for each local port that receives connections. There is an outbound
|
||||
// route for each protocol and authority.
|
||||
pub const ENV_INBOUND_ROUTER_CAPACITY: &str = "CONDUIT_PROXY_INBOUND_ROUTER_CAPACITY";
|
||||
pub const ENV_OUTBOUND_ROUTER_CAPACITY: &str = "CONDUIT_PROXY_OUTBOUND_ROUTER_CAPACITY";
|
||||
pub const ENV_INBOUND_ROUTER_CAPACITY: &str = "LINKERD2_PROXY_INBOUND_ROUTER_CAPACITY";
|
||||
pub const ENV_OUTBOUND_ROUTER_CAPACITY: &str = "LINKERD2_PROXY_OUTBOUND_ROUTER_CAPACITY";
|
||||
|
||||
pub const ENV_INBOUND_ROUTER_MAX_IDLE_AGE: &str = "CONDUIT_PROXY_INBOUND_ROUTER_MAX_IDLE_AGE";
|
||||
pub const ENV_OUTBOUND_ROUTER_MAX_IDLE_AGE: &str = "CONDUIT_PROXY_OUTBOUND_ROUTER_MAX_IDLE_AGE";
|
||||
pub const ENV_INBOUND_ROUTER_MAX_IDLE_AGE: &str = "LINKERD2_PROXY_INBOUND_ROUTER_MAX_IDLE_AGE";
|
||||
pub const ENV_OUTBOUND_ROUTER_MAX_IDLE_AGE: &str = "LINKERD2_PROXY_OUTBOUND_ROUTER_MAX_IDLE_AGE";
|
||||
|
||||
// These *disable* our protocol detection for connections whose SO_ORIGINAL_DST
|
||||
// has a port in the provided list.
|
||||
pub const ENV_INBOUND_PORTS_DISABLE_PROTOCOL_DETECTION: &str = "CONDUIT_PROXY_INBOUND_PORTS_DISABLE_PROTOCOL_DETECTION";
|
||||
pub const ENV_OUTBOUND_PORTS_DISABLE_PROTOCOL_DETECTION: &str = "CONDUIT_PROXY_OUTBOUND_PORTS_DISABLE_PROTOCOL_DETECTION";
|
||||
pub const ENV_INBOUND_PORTS_DISABLE_PROTOCOL_DETECTION: &str = "LINKERD2_PROXY_INBOUND_PORTS_DISABLE_PROTOCOL_DETECTION";
|
||||
pub const ENV_OUTBOUND_PORTS_DISABLE_PROTOCOL_DETECTION: &str = "LINKERD2_PROXY_OUTBOUND_PORTS_DISABLE_PROTOCOL_DETECTION";
|
||||
|
||||
pub const ENV_TLS_TRUST_ANCHORS: &str = "CONDUIT_PROXY_TLS_TRUST_ANCHORS";
|
||||
pub const ENV_TLS_CERT: &str = "CONDUIT_PROXY_TLS_CERT";
|
||||
pub const ENV_TLS_PRIVATE_KEY: &str = "CONDUIT_PROXY_TLS_PRIVATE_KEY";
|
||||
pub const ENV_TLS_POD_IDENTITY: &str = "CONDUIT_PROXY_TLS_POD_IDENTITY";
|
||||
pub const ENV_TLS_CONTROLLER_IDENTITY: &str = "CONDUIT_PROXY_TLS_CONTROLLER_IDENTITY";
|
||||
pub const ENV_TLS_TRUST_ANCHORS: &str = "LINKERD2_PROXY_TLS_TRUST_ANCHORS";
|
||||
pub const ENV_TLS_CERT: &str = "LINKERD2_PROXY_TLS_CERT";
|
||||
pub const ENV_TLS_PRIVATE_KEY: &str = "LINKERD2_PROXY_TLS_PRIVATE_KEY";
|
||||
pub const ENV_TLS_POD_IDENTITY: &str = "LINKERD2_PROXY_TLS_POD_IDENTITY";
|
||||
pub const ENV_TLS_CONTROLLER_IDENTITY: &str = "LINKERD2_PROXY_TLS_CONTROLLER_IDENTITY";
|
||||
|
||||
pub const ENV_CONTROLLER_NAMESPACE: &str = "CONDUIT_PROXY_CONTROLLER_NAMESPACE";
|
||||
pub const ENV_POD_NAMESPACE: &str = "CONDUIT_PROXY_POD_NAMESPACE";
|
||||
pub const VAR_POD_NAMESPACE: &str = "$CONDUIT_PROXY_POD_NAMESPACE";
|
||||
pub const ENV_CONTROLLER_NAMESPACE: &str = "LINKERD2_PROXY_CONTROLLER_NAMESPACE";
|
||||
pub const ENV_POD_NAMESPACE: &str = "LINKERD2_PROXY_POD_NAMESPACE";
|
||||
pub const VAR_POD_NAMESPACE: &str = "$LINKERD2_PROXY_POD_NAMESPACE";
|
||||
|
||||
pub const ENV_CONTROL_URL: &str = "CONDUIT_PROXY_CONTROL_URL";
|
||||
const ENV_RESOLV_CONF: &str = "CONDUIT_RESOLV_CONF";
|
||||
pub const ENV_CONTROL_URL: &str = "LINKERD2_PROXY_CONTROL_URL";
|
||||
const ENV_RESOLV_CONF: &str = "LINKERD2_PROXY_RESOLV_CONF";
|
||||
|
||||
/// Configures a minimum value for the TTL of DNS lookups.
|
||||
///
|
||||
/// Lookups with TTLs below this value will use this value instead.
|
||||
const ENV_DNS_MIN_TTL: &str = "CONDUIT_PROXY_DNS_MIN_TTL";
|
||||
const ENV_DNS_MIN_TTL: &str = "LINKERD2_PROXY_DNS_MIN_TTL";
|
||||
/// Configures a maximum value for the TTL of DNS lookups.
|
||||
///
|
||||
/// Lookups with TTLs above this value will use this value instead.
|
||||
const ENV_DNS_MAX_TTL: &str = "CONDUIT_PROXY_DNS_MAX_TTL";
|
||||
const ENV_DNS_MAX_TTL: &str = "LINKERD2_PROXY_DNS_MAX_TTL";
|
||||
|
||||
// Default values for various configuration fields
|
||||
const DEFAULT_EVENT_BUFFER_CAPACITY: usize = 10_000; // FIXME
|
|
@ -19,13 +19,14 @@ use tower_grpc as grpc;
|
|||
use tower_h2::{self, BoxBody, HttpService, RecvBody};
|
||||
use tower_reconnect::Reconnect;
|
||||
|
||||
use conduit_proxy_controller_grpc::common::{Destination, TcpAddress};
|
||||
use conduit_proxy_controller_grpc::destination::client::Destination as DestinationSvc;
|
||||
use conduit_proxy_controller_grpc::destination::update::Update as PbUpdate2;
|
||||
use conduit_proxy_controller_grpc::destination::{
|
||||
use linkerd2_proxy_api::destination::client::Destination;
|
||||
use linkerd2_proxy_api::destination::update::Update as PbUpdate2;
|
||||
use linkerd2_proxy_api::destination::{
|
||||
GetDestination,
|
||||
Update as PbUpdate,
|
||||
WeightedAddr,
|
||||
};
|
||||
use linkerd2_proxy_api::net::TcpAddress;
|
||||
|
||||
use super::{Metadata, ResolveRequest, Responder, Update};
|
||||
use config::Namespaces;
|
||||
|
@ -352,11 +353,11 @@ where
|
|||
auth
|
||||
);
|
||||
FullyQualifiedAuthority::normalize(auth, default_destination_namespace).map(|auth| {
|
||||
let req = Destination {
|
||||
let req = GetDestination {
|
||||
scheme: "k8s".into(),
|
||||
path: auth.without_trailing_dot().to_owned(),
|
||||
};
|
||||
let mut svc = DestinationSvc::new(client.lift_ref());
|
||||
let mut svc = Destination::new(client.lift_ref());
|
||||
let response = svc.get(grpc::Request::new(req));
|
||||
Remote::ConnectedOrConnecting {
|
||||
rx: Receiver::new(response),
|
||||
|
@ -683,7 +684,7 @@ fn pb_to_addr_meta(
|
|||
}
|
||||
|
||||
fn pb_to_sock_addr(pb: TcpAddress) -> Option<SocketAddr> {
|
||||
use conduit_proxy_controller_grpc::common::ip_address::Ip;
|
||||
use linkerd2_proxy_api::net::ip_address::Ip;
|
||||
use std::net::{Ipv4Addr, Ipv6Addr};
|
||||
/*
|
||||
current structure is:
|
|
@ -8,7 +8,7 @@
|
|||
//!
|
||||
//! The number of active resolutions is not currently bounded by this module. Instead, we
|
||||
//! trust that callers of `Resolver` enforce such a constraint (for example, via
|
||||
//! `conduit_proxy_router`'s LRU cache). Additionally, users of this module must ensure
|
||||
//! `linkerd2_proxy_router`'s LRU cache). Additionally, users of this module must ensure
|
||||
//! they consume resolutions as they are sent so that the response channels don't grow
|
||||
//! without bounds.
|
||||
//!
|
|
@ -7,8 +7,7 @@ use http::HeaderMap;
|
|||
use indexmap::{Equivalent, IndexSet};
|
||||
use tower_grpc::{self as grpc, Response};
|
||||
|
||||
use conduit_proxy_controller_grpc::common::TapEvent;
|
||||
use conduit_proxy_controller_grpc::tap::{server, ObserveRequest};
|
||||
use linkerd2_proxy_api::tap::{server, ObserveRequest, TapEvent};
|
||||
use convert::*;
|
||||
use ctx;
|
||||
use telemetry::Event;
|
|
@ -5,7 +5,7 @@ use std::error::Error;
|
|||
use std::fmt;
|
||||
use std::sync::Arc;
|
||||
|
||||
use conduit_proxy_controller_grpc::*;
|
||||
use linkerd2_proxy_api::*;
|
||||
use convert::*;
|
||||
use ctx;
|
||||
use telemetry::{event, Event};
|
||||
|
@ -27,15 +27,13 @@ impl Error for UnknownEvent {
|
|||
}
|
||||
|
||||
impl event::StreamResponseEnd {
|
||||
fn to_tap_event(&self, ctx: &Arc<ctx::http::Request>) -> common::TapEvent {
|
||||
use ::conduit_proxy_controller_grpc::common::{tap_event, Eos};
|
||||
|
||||
fn to_tap_event(&self, ctx: &Arc<ctx::http::Request>) -> tap::TapEvent {
|
||||
let eos = self.grpc_status
|
||||
.map(Eos::from_grpc_status)
|
||||
.map(tap::Eos::from_grpc_status)
|
||||
;
|
||||
|
||||
let end = tap_event::http::ResponseEnd {
|
||||
id: Some(tap_event::http::StreamId {
|
||||
let end = tap::tap_event::http::ResponseEnd {
|
||||
id: Some(tap::tap_event::http::StreamId {
|
||||
base: 0, // TODO FIXME
|
||||
stream: ctx.id.into(),
|
||||
}),
|
||||
|
@ -45,25 +43,23 @@ impl event::StreamResponseEnd {
|
|||
eos,
|
||||
};
|
||||
|
||||
common::TapEvent {
|
||||
tap::TapEvent {
|
||||
proxy_direction: ctx.server.direction().into(),
|
||||
source: Some((&ctx.server.remote).into()),
|
||||
source_meta: Some(ctx.server.src_meta()),
|
||||
destination: Some((&ctx.client.remote).into()),
|
||||
destination_meta: Some(ctx.client.dst_meta()),
|
||||
event: Some(tap_event::Event::Http(tap_event::Http {
|
||||
event: Some(tap_event::http::Event::ResponseEnd(end)),
|
||||
event: Some(tap::tap_event::Event::Http(tap::tap_event::Http {
|
||||
event: Some(tap::tap_event::http::Event::ResponseEnd(end)),
|
||||
})),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl event::StreamResponseFail {
|
||||
fn to_tap_event(&self, ctx: &Arc<ctx::http::Request>) -> common::TapEvent {
|
||||
use self::common::tap_event;
|
||||
|
||||
let end = tap_event::http::ResponseEnd {
|
||||
id: Some(tap_event::http::StreamId {
|
||||
fn to_tap_event(&self, ctx: &Arc<ctx::http::Request>) -> tap::TapEvent {
|
||||
let end = tap::tap_event::http::ResponseEnd {
|
||||
id: Some(tap::tap_event::http::StreamId {
|
||||
base: 0, // TODO FIXME
|
||||
stream: ctx.id.into(),
|
||||
}),
|
||||
|
@ -73,25 +69,23 @@ impl event::StreamResponseFail {
|
|||
eos: Some(self.error.into()),
|
||||
};
|
||||
|
||||
common::TapEvent {
|
||||
tap::TapEvent {
|
||||
proxy_direction: ctx.server.direction().into(),
|
||||
source: Some((&ctx.server.remote).into()),
|
||||
source_meta: Some(ctx.server.src_meta()),
|
||||
destination: Some((&ctx.client.remote).into()),
|
||||
destination_meta: Some(ctx.client.dst_meta()),
|
||||
event: Some(tap_event::Event::Http(tap_event::Http {
|
||||
event: Some(tap_event::http::Event::ResponseEnd(end)),
|
||||
event: Some(tap::tap_event::Event::Http(tap::tap_event::Http {
|
||||
event: Some(tap::tap_event::http::Event::ResponseEnd(end)),
|
||||
})),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl event::StreamRequestFail {
|
||||
fn to_tap_event(&self, ctx: &Arc<ctx::http::Request>) -> common::TapEvent {
|
||||
use self::common::tap_event;
|
||||
|
||||
let end = tap_event::http::ResponseEnd {
|
||||
id: Some(tap_event::http::StreamId {
|
||||
fn to_tap_event(&self, ctx: &Arc<ctx::http::Request>) -> tap::TapEvent {
|
||||
let end = tap::tap_event::http::ResponseEnd {
|
||||
id: Some(tap::tap_event::http::StreamId {
|
||||
base: 0, // TODO FIXME
|
||||
stream: ctx.id.into(),
|
||||
}),
|
||||
|
@ -101,34 +95,32 @@ impl event::StreamRequestFail {
|
|||
eos: Some(self.error.into()),
|
||||
};
|
||||
|
||||
common::TapEvent {
|
||||
tap::TapEvent {
|
||||
proxy_direction: ctx.server.direction().into(),
|
||||
source: Some((&ctx.server.remote).into()),
|
||||
source_meta: Some(ctx.server.src_meta()),
|
||||
destination: Some((&ctx.client.remote).into()),
|
||||
destination_meta: Some(ctx.client.dst_meta()),
|
||||
event: Some(tap_event::Event::Http(tap_event::Http {
|
||||
event: Some(tap_event::http::Event::ResponseEnd(end)),
|
||||
event: Some(tap::tap_event::Event::Http(tap::tap_event::Http {
|
||||
event: Some(tap::tap_event::http::Event::ResponseEnd(end)),
|
||||
})),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> TryFrom<&'a Event> for common::TapEvent {
|
||||
impl<'a> TryFrom<&'a Event> for tap::TapEvent {
|
||||
type Err = UnknownEvent;
|
||||
fn try_from(ev: &'a Event) -> Result<Self, Self::Err> {
|
||||
use self::common::tap_event;
|
||||
|
||||
let tap_ev = match *ev {
|
||||
Event::StreamRequestOpen(ref ctx) => {
|
||||
let init = tap_event::http::RequestInit {
|
||||
id: Some(tap_event::http::StreamId {
|
||||
let init = tap::tap_event::http::RequestInit {
|
||||
id: Some(tap::tap_event::http::StreamId {
|
||||
base: 0,
|
||||
// TODO FIXME
|
||||
stream: ctx.id.into(),
|
||||
}),
|
||||
method: Some((&ctx.method).into()),
|
||||
scheme: ctx.uri.scheme_part().map(common::Scheme::from),
|
||||
scheme: ctx.uri.scheme_part().map(tap::Scheme::from),
|
||||
authority: ctx.uri
|
||||
.authority_part()
|
||||
.map(|a| a.as_str())
|
||||
|
@ -137,21 +129,21 @@ impl<'a> TryFrom<&'a Event> for common::TapEvent {
|
|||
path: ctx.uri.path().into(),
|
||||
};
|
||||
|
||||
common::TapEvent {
|
||||
tap::TapEvent {
|
||||
proxy_direction: ctx.server.direction().into(),
|
||||
source: Some((&ctx.server.remote).into()),
|
||||
source_meta: Some(ctx.server.src_meta()),
|
||||
destination: Some((&ctx.client.remote).into()),
|
||||
destination_meta: Some(ctx.client.dst_meta()),
|
||||
event: Some(tap_event::Event::Http(tap_event::Http {
|
||||
event: Some(tap_event::http::Event::RequestInit(init)),
|
||||
event: Some(tap::tap_event::Event::Http(tap::tap_event::Http {
|
||||
event: Some(tap::tap_event::http::Event::RequestInit(init)),
|
||||
})),
|
||||
}
|
||||
}
|
||||
|
||||
Event::StreamResponseOpen(ref ctx, ref rsp) => {
|
||||
let init = tap_event::http::ResponseInit {
|
||||
id: Some(tap_event::http::StreamId {
|
||||
let init = tap::tap_event::http::ResponseInit {
|
||||
id: Some(tap::tap_event::http::StreamId {
|
||||
base: 0,
|
||||
// TODO FIXME
|
||||
stream: ctx.request.id.into(),
|
||||
|
@ -160,14 +152,14 @@ impl<'a> TryFrom<&'a Event> for common::TapEvent {
|
|||
http_status: u32::from(ctx.status.as_u16()),
|
||||
};
|
||||
|
||||
common::TapEvent {
|
||||
tap::TapEvent {
|
||||
proxy_direction: ctx.request.server.direction().into(),
|
||||
source: Some((&ctx.request.server.remote).into()),
|
||||
source_meta: Some(ctx.request.server.src_meta()),
|
||||
destination: Some((&ctx.request.client.remote).into()),
|
||||
destination_meta: Some(ctx.request.client.dst_meta()),
|
||||
event: Some(tap_event::Event::Http(tap_event::Http {
|
||||
event: Some(tap_event::http::Event::ResponseInit(init)),
|
||||
event: Some(tap::tap_event::Event::Http(tap::tap_event::Http {
|
||||
event: Some(tap::tap_event::http::Event::ResponseInit(init)),
|
||||
})),
|
||||
}
|
||||
}
|
||||
|
@ -192,26 +184,26 @@ impl<'a> TryFrom<&'a Event> for common::TapEvent {
|
|||
}
|
||||
|
||||
impl ctx::transport::Server {
|
||||
fn src_meta(&self) -> common::tap_event::EndpointMeta {
|
||||
let mut meta = common::tap_event::EndpointMeta::default();
|
||||
fn src_meta(&self) -> tap::tap_event::EndpointMeta {
|
||||
let mut meta = tap::tap_event::EndpointMeta::default();
|
||||
|
||||
meta.labels.insert("tls".to_owned(), format!("{}", self.tls_status));
|
||||
|
||||
meta
|
||||
}
|
||||
|
||||
fn direction(&self) -> common::tap_event::ProxyDirection {
|
||||
fn direction(&self) -> tap::tap_event::ProxyDirection {
|
||||
if self.proxy.is_outbound() {
|
||||
common::tap_event::ProxyDirection::Outbound
|
||||
tap::tap_event::ProxyDirection::Outbound
|
||||
} else {
|
||||
common::tap_event::ProxyDirection::Inbound
|
||||
tap::tap_event::ProxyDirection::Inbound
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ctx::transport::Client {
|
||||
fn dst_meta(&self) -> common::tap_event::EndpointMeta {
|
||||
let mut meta = common::tap_event::EndpointMeta::default();
|
||||
fn dst_meta(&self) -> tap::tap_event::EndpointMeta {
|
||||
let mut meta = tap::tap_event::EndpointMeta::default();
|
||||
|
||||
if let Some(ref d) = self.dst_labels() {
|
||||
for (k, v) in d.as_map() {
|
|
@ -6,7 +6,7 @@ use tower_service as tower;
|
|||
use tower_buffer::{self, Buffer};
|
||||
use tower_in_flight_limit::{self, InFlightLimit};
|
||||
use tower_h2;
|
||||
use conduit_proxy_router::Recognize;
|
||||
use linkerd2_proxy_router::Recognize;
|
||||
|
||||
use bind;
|
||||
use ctx;
|
||||
|
@ -104,7 +104,7 @@ mod tests {
|
|||
use std::sync::Arc;
|
||||
|
||||
use http;
|
||||
use conduit_proxy_router::Recognize;
|
||||
use linkerd2_proxy_router::Recognize;
|
||||
|
||||
use super::Inbound;
|
||||
use bind::{self, Bind, Host};
|
|
@ -3,7 +3,7 @@
|
|||
#![deny(warnings)]
|
||||
|
||||
extern crate bytes;
|
||||
extern crate conduit_proxy_controller_grpc;
|
||||
extern crate linkerd2_proxy_api;
|
||||
extern crate env_logger;
|
||||
extern crate deflate;
|
||||
#[macro_use]
|
||||
|
@ -46,7 +46,7 @@ extern crate tower_h2;
|
|||
extern crate tower_h2_balance;
|
||||
extern crate tower_reconnect;
|
||||
extern crate tower_service;
|
||||
extern crate conduit_proxy_router;
|
||||
extern crate linkerd2_proxy_router;
|
||||
extern crate tower_util;
|
||||
extern crate tower_in_flight_limit;
|
||||
extern crate trust_dns_resolver;
|
||||
|
@ -68,7 +68,7 @@ use tokio::{
|
|||
};
|
||||
use tower_service::NewService;
|
||||
use tower_fn::*;
|
||||
use conduit_proxy_router::{Recognize, Router, Error as RouteError};
|
||||
use linkerd2_proxy_router::{Recognize, Router, Error as RouteError};
|
||||
|
||||
pub mod app;
|
||||
mod bind;
|
||||
|
@ -324,7 +324,7 @@ where
|
|||
thread::Builder::new()
|
||||
.name("admin".into())
|
||||
.spawn(move || {
|
||||
use conduit_proxy_controller_grpc::tap::server::TapServer;
|
||||
use linkerd2_proxy_api::tap::server::TapServer;
|
||||
|
||||
let mut rt = current_thread::Runtime::new()
|
||||
.expect("initialize admin thread runtime");
|
|
@ -10,7 +10,7 @@ use futures::{Future, Poll};
|
|||
use futures::future::{ExecuteError, Executor};
|
||||
use log::{Level};
|
||||
|
||||
const ENV_LOG: &str = "CONDUIT_PROXY_LOG";
|
||||
const ENV_LOG: &str = "LINKERD2_PROXY_LOG";
|
||||
|
||||
thread_local! {
|
||||
static CONTEXT: RefCell<Vec<*const fmt::Display>> = RefCell::new(Vec::new());
|
|
@ -1,6 +1,6 @@
|
|||
#![deny(warnings)]
|
||||
|
||||
extern crate conduit_proxy;
|
||||
extern crate linkerd2_proxy;
|
||||
|
||||
#[macro_use] extern crate log;
|
||||
extern crate tokio;
|
||||
|
@ -12,7 +12,7 @@ mod signal;
|
|||
// Look in lib.rs.
|
||||
fn main() {
|
||||
// Load configuration.
|
||||
let config = match conduit_proxy::app::init() {
|
||||
let config = match linkerd2_proxy::app::init() {
|
||||
Ok(c) => c,
|
||||
Err(e) => {
|
||||
eprintln!("configuration error: {:#?}", e);
|
||||
|
@ -23,9 +23,9 @@ fn main() {
|
|||
// runtime instead, if acting as an ingress proxy.
|
||||
let runtime = tokio::runtime::current_thread::Runtime::new()
|
||||
.expect("initialize main runtime");
|
||||
let main = conduit_proxy::Main::new(
|
||||
let main = linkerd2_proxy::Main::new(
|
||||
config,
|
||||
conduit_proxy::SoOriginalDst,
|
||||
linkerd2_proxy::SoOriginalDst,
|
||||
runtime,
|
||||
);
|
||||
let shutdown_signal = signal::shutdown();
|
|
@ -12,7 +12,7 @@ use tower_discover::{Change, Discover};
|
|||
use tower_in_flight_limit::InFlightLimit;
|
||||
use tower_h2;
|
||||
use tower_h2_balance::{PendingUntilFirstData, PendingUntilFirstDataBody};
|
||||
use conduit_proxy_router::Recognize;
|
||||
use linkerd2_proxy_router::Recognize;
|
||||
|
||||
use bind::{self, Bind, Protocol};
|
||||
use control::destination::{self, Bind as BindTrait, Resolution};
|
|
@ -41,7 +41,7 @@ mod imp {
|
|||
.map(move |_| {
|
||||
info!(
|
||||
// use target to remove 'imp' from output
|
||||
target: "conduit_proxy::signal",
|
||||
target: "linkerd2_proxy::signal",
|
||||
"received {}, starting shutdown",
|
||||
DisplaySignal(sig),
|
||||
);
|
||||
|
@ -88,7 +88,7 @@ mod imp {
|
|||
.map(|_| {
|
||||
info!(
|
||||
// use target to remove 'imp' from output
|
||||
target: "conduit_proxy::signal",
|
||||
target: "linkerd2_proxy::signal",
|
||||
"received Ctrl-C, starting shutdown",
|
||||
);
|
||||
})
|
|
@ -7,8 +7,8 @@ use http;
|
|||
use ipnet::{Contains, Ipv4Net, Ipv6Net};
|
||||
|
||||
use super::Event;
|
||||
use conduit_proxy_controller_grpc::common::ip_address;
|
||||
use conduit_proxy_controller_grpc::tap::observe_request;
|
||||
use linkerd2_proxy_api::net::ip_address;
|
||||
use linkerd2_proxy_api::tap::observe_request;
|
||||
use convert::TryFrom;
|
||||
use ctx;
|
||||
|
||||
|
@ -165,7 +165,7 @@ impl<'a> TryFrom<&'a observe_request::match_::Match> for Match {
|
|||
|
||||
#[allow(unconditional_recursion)]
|
||||
fn try_from(m: &observe_request::match_::Match) -> Result<Self, Self::Err> {
|
||||
use conduit_proxy_controller_grpc::tap::observe_request::match_;
|
||||
use linkerd2_proxy_api::tap::observe_request::match_;
|
||||
|
||||
let match_ = match *m {
|
||||
match_::Match::All(ref seq) => Match::All(Self::from_seq(seq)?),
|
||||
|
@ -233,7 +233,7 @@ impl<'a> TryFrom<&'a observe_request::match_::Tcp> for TcpMatch {
|
|||
type Err = InvalidMatch;
|
||||
|
||||
fn try_from(m: &observe_request::match_::Tcp) -> Result<Self, InvalidMatch> {
|
||||
use conduit_proxy_controller_grpc::tap::observe_request::match_::tcp;
|
||||
use linkerd2_proxy_api::tap::observe_request::match_::tcp;
|
||||
|
||||
let m = match m.match_.as_ref() {
|
||||
None => return Err(InvalidMatch::Empty),
|
||||
|
@ -336,7 +336,7 @@ impl HttpMatch {
|
|||
string_match: &observe_request::match_::http::string_match::Match,
|
||||
value: &str,
|
||||
) -> bool {
|
||||
use conduit_proxy_controller_grpc::tap::observe_request::match_::http::string_match::Match::*;
|
||||
use linkerd2_proxy_api::tap::observe_request::match_::http::string_match::Match::*;
|
||||
|
||||
match *string_match {
|
||||
Exact(ref exact) => value == exact,
|
||||
|
@ -348,7 +348,7 @@ impl HttpMatch {
|
|||
impl<'a> TryFrom<&'a observe_request::match_::Http> for HttpMatch {
|
||||
type Err = InvalidMatch;
|
||||
fn try_from(m: &'a observe_request::match_::Http) -> Result<Self, InvalidMatch> {
|
||||
use conduit_proxy_controller_grpc::tap::observe_request::match_::http::Match as Pb;
|
||||
use linkerd2_proxy_api::tap::observe_request::match_::http::Match as Pb;
|
||||
|
||||
m.match_
|
||||
.as_ref()
|
||||
|
@ -391,7 +391,7 @@ mod tests {
|
|||
use quickcheck::*;
|
||||
|
||||
use super::*;
|
||||
use conduit_proxy_controller_grpc::*;
|
||||
use linkerd2_proxy_api::tap;
|
||||
|
||||
impl Arbitrary for LabelMatch {
|
||||
fn arbitrary<G: Gen>(g: &mut G) -> Self {
|
||||
|
@ -491,7 +491,7 @@ mod tests {
|
|||
Some(&http::Match::Method(ref m)) => {
|
||||
match m.type_.as_ref() {
|
||||
None => Some(InvalidMatch::Empty),
|
||||
Some(&common::http_method::Type::Unregistered(ref m)) => if m.len() <= 15 {
|
||||
Some(&tap::http_method::Type::Unregistered(ref m)) => if m.len() <= 15 {
|
||||
let mut err = None;
|
||||
if let Err(_) = ::http::Method::from_bytes(m.as_bytes()) {
|
||||
err = Some(InvalidMatch::InvalidHttpMethod);
|
||||
|
@ -500,7 +500,7 @@ mod tests {
|
|||
} else {
|
||||
Some(InvalidMatch::InvalidHttpMethod)
|
||||
}
|
||||
Some(&common::http_method::Type::Registered(m)) => if m < 9 {
|
||||
Some(&tap::http_method::Type::Registered(m)) => if m < 9 {
|
||||
None
|
||||
} else {
|
||||
Some(InvalidMatch::InvalidHttpMethod)
|
||||
|
@ -510,8 +510,8 @@ mod tests {
|
|||
Some(&http::Match::Scheme(ref m)) => {
|
||||
match m.type_.as_ref() {
|
||||
None => Some(InvalidMatch::Empty),
|
||||
Some(&common::scheme::Type::Unregistered(_)) => None,
|
||||
Some(&common::scheme::Type::Registered(m)) => {
|
||||
Some(&tap::scheme::Type::Unregistered(_)) => None,
|
||||
Some(&tap::scheme::Type::Registered(m)) => {
|
||||
if m < 2 {
|
||||
None
|
||||
} else {
|
|
@ -1,7 +1,7 @@
|
|||
use futures_mpsc_lossy;
|
||||
use indexmap::IndexMap;
|
||||
|
||||
use conduit_proxy_controller_grpc::tap::observe_request;
|
||||
use linkerd2_proxy_api::tap::observe_request;
|
||||
|
||||
use super::Event;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
use conduit_proxy_controller_grpc;
|
||||
use linkerd2_proxy_api;
|
||||
use convert::TryFrom;
|
||||
use super::{DnsName, InvalidDnsName, webpki};
|
||||
use std::sync::Arc;
|
||||
|
@ -16,10 +16,10 @@ impl Identity {
|
|||
/// information is returned.
|
||||
pub fn maybe_from_protobuf(
|
||||
controller_namespace: Option<&str>,
|
||||
pb: conduit_proxy_controller_grpc::destination::TlsIdentity)
|
||||
pb: linkerd2_proxy_api::destination::TlsIdentity)
|
||||
-> Result<Option<Self>, ()>
|
||||
{
|
||||
use conduit_proxy_controller_grpc::destination::tls_identity::Strategy;
|
||||
use linkerd2_proxy_api::destination::tls_identity::Strategy;
|
||||
match pb.strategy {
|
||||
Some(Strategy::K8sPodIdentity(i)) => {
|
||||
// XXX: If we don't know the controller's namespace or we don't
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue