Skip to content

Commit

Permalink
Merge pull request #1083 from apricote/hetzner-fix-prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
jlebon committed Jun 19, 2024
2 parents b95fcd1 + 6effcd3 commit 547c950
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
2 changes: 2 additions & 0 deletions docs/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Major changes:

Minor changes:

- Hetzner: fix duplicate attribute prefix

Packaging changes:


Expand Down
10 changes: 5 additions & 5 deletions src/providers/hetzner/mock_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ vendor_data: "blah blah blah""#
);

let expected = maplit::hashmap! {
"AFTERBURN_HETZNER_AVAILABILITY_ZONE".to_string() => availability_zone.to_string(),
"AFTERBURN_HETZNER_HOSTNAME".to_string() => hostname.to_string(),
"AFTERBURN_HETZNER_INSTANCE_ID".to_string() => instance_id.to_string(),
"AFTERBURN_HETZNER_PUBLIC_IPV4".to_string() => public_ipv4.to_string(),
"AFTERBURN_HETZNER_REGION".to_string() => region.to_string(),
"HETZNER_AVAILABILITY_ZONE".to_string() => availability_zone.to_string(),
"HETZNER_HOSTNAME".to_string() => hostname.to_string(),
"HETZNER_INSTANCE_ID".to_string() => instance_id.to_string(),
"HETZNER_PUBLIC_IPV4".to_string() => public_ipv4.to_string(),
"HETZNER_REGION".to_string() => region.to_string(),
};

// Fail on not found
Expand Down
10 changes: 5 additions & 5 deletions src/providers/hetzner/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,17 @@ impl From<HetznerMetadata> for HashMap<String, String> {

add_value(
&mut out,
"AFTERBURN_HETZNER_AVAILABILITY_ZONE",
"HETZNER_AVAILABILITY_ZONE",
meta.availability_zone,
);
add_value(&mut out, "AFTERBURN_HETZNER_HOSTNAME", meta.hostname);
add_value(&mut out, "HETZNER_HOSTNAME", meta.hostname);
add_value(
&mut out,
"AFTERBURN_HETZNER_INSTANCE_ID",
"HETZNER_INSTANCE_ID",
meta.instance_id.map(|i| i.to_string()),
);
add_value(&mut out, "AFTERBURN_HETZNER_PUBLIC_IPV4", meta.public_ipv4);
add_value(&mut out, "AFTERBURN_HETZNER_REGION", meta.region);
add_value(&mut out, "HETZNER_PUBLIC_IPV4", meta.public_ipv4);
add_value(&mut out, "HETZNER_REGION", meta.region);

out
}
Expand Down

0 comments on commit 547c950

Please sign in to comment.