providers/digitalocean: private ip index bug fix
Environment variables for private IP addresses are mistakenly assigned
a name using the public_counter variable. If there are one public IP and
one private IP in the droplet metadata JSON, this leads to the private
IP having a suffix of _1 instead of _0 as expected.
@@ -121,7 +121,7 @@ fn parse_attrs(data: &Metadata) -> Result<Vec<(String,String)>> {
for a in ifaces {
if a.ipv4.is_some() {
attrs.push((
- format!("DIGITALOCEAN_IPV4_PRIVATE_{}", public_counter),
+ format!("DIGITALOCEAN_IPV4_PRIVATE_{}", private_counter),
format!("{}", a.ipv4.unwrap().ip_address)
));
}
