From b45082ac5c00820ab29090eea87229eccded7a13 Mon Sep 17 00:00:00 2001 From: Mat Sadler Date: Thu, 26 Apr 2018 15:46:20 -0700 Subject: [PATCH] get STATSD_HOST from the right place --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/avvoenv/rancher_metadata.rs | 9 +++++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bb3dcd3..5cd4b15 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14,7 +14,7 @@ dependencies = [ [[package]] name = "avvoenv" -version = "0.4.0" +version = "0.4.1" dependencies = [ "getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index d38470a..3fde1a5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "avvoenv" -version = "0.4.0" +version = "0.4.1" authors = ["Avvo Infrastructure Team "] license = "MIT" diff --git a/src/avvoenv/rancher_metadata.rs b/src/avvoenv/rancher_metadata.rs index 2806cab..cc7f737 100644 --- a/src/avvoenv/rancher_metadata.rs +++ b/src/avvoenv/rancher_metadata.rs @@ -18,7 +18,12 @@ struct Container { #[derive(Deserialize)] struct Host { - hostname: String, + labels: Labels, +} + +#[derive(Deserialize)] +struct Labels { + fqdn: String, } #[derive(Deserialize)] @@ -34,7 +39,7 @@ impl std::iter::IntoIterator for Info { fn into_iter(self) -> Self::IntoIter { vec![ (String::from("RANCHER_IP"), self.container.primary_ip), - (String::from("STATSD_HOST"), self.host.hostname), + (String::from("STATSD_HOST"), self.host.labels.fqdn), ].into_iter() } }