diff options
author | Alex Auvolat <alex@adnab.me> | 2022-01-13 12:24:25 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-01-13 12:24:25 +0100 |
commit | 85e1e7d8a4669ff46bbb75353f544605ebd603ea (patch) | |
tree | 942a39ef2f4ae820ce14f4c4a91b57287802dce8 /src/proxy_config.rs | |
parent | e446d6763e2747bf4dc88ffc845e8b39a0b33451 (diff) | |
download | tricot-85e1e7d8a4669ff46bbb75353f544605ebd603ea.tar.gz tricot-85e1e7d8a4669ff46bbb75353f544605ebd603ea.zip |
Add support for tricot-site-lb and tricot-global-lb tagsdocker-29
Diffstat (limited to 'src/proxy_config.rs')
-rw-r--r-- | src/proxy_config.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/proxy_config.rs b/src/proxy_config.rs index a64e5aa..4add98c 100644 --- a/src/proxy_config.rs +++ b/src/proxy_config.rs @@ -194,6 +194,14 @@ fn parse_consul_catalog( }; let addr = SocketAddr::new(ip_addr, svc.port); + let (same_node, same_site) = if svc.tags.contains(&"tricot-global-lb".into()) { + (false, false) + } else if svc.tags.contains(&"tricot-site-lb".into()) { + (false, same_site) + } else { + (same_node, same_site) + }; + let mut add_headers = vec![]; for tag in svc.tags.iter() { if let Some(pair) = parse_tricot_add_header_tag(tag) { |