remove hostname from config

This commit is contained in:
Luna Yao
2026-04-06 11:54:50 +02:00
parent 56f430bf10
commit d5d600a524
5 changed files with 58 additions and 66 deletions
+2 -3
View File
@@ -492,7 +492,7 @@ impl NetworkConfig {
.parse()
.with_context(|| format!("failed to parse instance id: {:?}", self.instance_id))?,
);
cfg.set_hostname(self.hostname.clone());
self.hostname.as_ref().map(|n| cfg.set_hostname(n));
cfg.set_dhcp(self.dhcp.unwrap_or_default());
cfg.set_inst_name(self.network_name.clone().unwrap_or_default());
@@ -1033,8 +1033,7 @@ mod tests {
config.set_dhcp(rng.gen_bool(0.5));
if rng.gen_bool(0.7) {
let hostname = format!("host-{}", rng.gen::<u16>());
config.set_hostname(Some(hostname));
config.set_hostname(&format!("host-{}", rng.gen::<u16>()));
}
config.set_network_identity(crate::common::config::NetworkIdentity::new(