Skip to content

Commit

Permalink
Rename PUBLIC_IPV4 to IPV4_PUBLIC
Browse files Browse the repository at this point in the history
Signed-off-by: Felix Ehrenpfort <[email protected]>
  • Loading branch information
Felix Ehrenpfort committed Aug 28, 2023
1 parent c164ecd commit c4992fa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/providers/scaleway/mock_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ fn test_attributes() {
"SCALEWAY_INSTANCE_ID".to_string() => "11111111-1111-1111-1111-111111111111".to_string(),
"SCALEWAY_INSTANCE_TYPE".to_string() => "GP1-M".to_string(),
"SCALEWAY_HOSTNAME".to_string() => "frontend-0".to_string(),
"SCALEWAY_PRIVATE_IPV4".to_string() => "10.0.0.2".to_string(),
"SCALEWAY_PUBLIC_IPV4".to_string() => "93.184.216.34".to_string(),
"SCALEWAY_PUBLIC_IPV6".to_string() => "2001:db8::1".to_string(),
"SCALEWAY_IPV4_PRIVATE".to_string() => "10.0.0.2".to_string(),
"SCALEWAY_IPV4_PUBLIC".to_string() => "93.184.216.34".to_string(),
"SCALEWAY_IPV6_PUBLIC".to_string() => "2001:db8::1".to_string(),
"SCALEWAY_ZONE_ID".to_string() => "par1".to_string(),
};

Expand Down
14 changes: 7 additions & 7 deletions src/providers/scaleway/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@ struct ScalewaySSHPublicKey {
#[derive(Clone, Deserialize)]
struct ScalwayInterfaces {
private_ip: Option<String>,
public_ip: Option<ScalewayPublicIPv4>,
ipv6: Option<ScalewayPublicIPv6>,
public_ip: Option<ScalewayIPv4Public>,
ipv6: Option<ScalewayIPv6Public>,
}

#[derive(Clone, Deserialize)]
struct ScalewayPublicIPv4 {
struct ScalewayIPv4Public {
address: String,
}

#[derive(Clone, Deserialize)]
struct ScalewayPublicIPv6 {
struct ScalewayIPv6Public {
address: String,
}

Expand Down Expand Up @@ -110,15 +110,15 @@ impl ScalewayProvider {
];

if let Some(ref ip) = data.interfaces.private_ip {
attrs.push(("SCALEWAY_PRIVATE_IPV4".to_string(), ip.clone()));
attrs.push(("SCALEWAY_IPV4_PRIVATE".to_string(), ip.clone()));
}

if let Some(ref ip) = data.interfaces.public_ip {
attrs.push(("SCALEWAY_PUBLIC_IPV4".to_string(), ip.address.clone()));
attrs.push(("SCALEWAY_IPV4_PUBLIC".to_string(), ip.address.clone()));
}

if let Some(ref ip) = data.interfaces.ipv6 {
attrs.push(("SCALEWAY_PUBLIC_IPV6".to_string(), ip.address.clone()));
attrs.push(("SCALEWAY_IPV6_PUBLIC".to_string(), ip.address.clone()));
}

Ok(attrs)
Expand Down

0 comments on commit c4992fa

Please sign in to comment.