Skip to content

Commit

Permalink
proxmoxve: don't generate hostname attirbute if no hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
arcln committed Jun 13, 2024
1 parent 668bbe3 commit b1a75fe
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/providers/proxmoxve/cloudconfig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,15 @@ impl MetadataProvider for ProxmoxVECloudConfig {
fn attributes(&self) -> Result<HashMap<String, String>> {
let mut out = HashMap::new();

out.insert(
"PROXMOXVE_HOSTNAME".to_owned(),
self.hostname()?.unwrap_or_default(),
);

out.insert(
"PROXMOXVE_INSTANCE_ID".to_owned(),
self.meta_data.instance_id.clone(),
);

if let Some(hostname) = self.hostname()? {
out.insert("PROXMOXVE_HOSTNAME".to_owned(), hostname);
}

if let Some(first_interface) = self.networks()?.first() {
first_interface.ip_addresses.iter().for_each(|ip| match ip {
IpNetwork::V4(network) => {
Expand Down

0 comments on commit b1a75fe

Please sign in to comment.