From 8e0bca9dd87171f84b588d96be9f95f3f6e33249 Mon Sep 17 00:00:00 2001 From: ghe0 Date: Fri, 21 Mar 2025 20:11:38 +0200 Subject: [PATCH] remove VM hostname from the responsabilities --- Cargo.lock | 2 +- src/state.rs | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 606d9b0..bc3ab7d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -373,7 +373,7 @@ dependencies = [ [[package]] name = "detee-shared" version = "0.1.0" -source = "git+ssh://git@gitea.detee.cloud/testnet/proto?branch=main#cf0c9a2c0d2edf9254f25c6faa7494afcfa00d64" +source = "git+ssh://git@gitea.detee.cloud/testnet/proto?branch=main#70e83dd0e982eeb491212c4a9d265df0b148fe24" dependencies = [ "base64", "prost", diff --git a/src/state.rs b/src/state.rs index b53a790..28c60f1 100644 --- a/src/state.rs +++ b/src/state.rs @@ -391,7 +391,6 @@ pub struct VMNIC { #[derive(Serialize, Deserialize, Debug)] pub struct VM { pub uuid: String, - hostname: String, admin_key: String, fw_ports: Vec<(u16, u16)>, nics: Vec, @@ -459,7 +458,6 @@ impl From for snp_proto::UpdateVmResp { #[derive(Deserialize, Debug)] pub struct NewVMRequest { uuid: String, - hostname: String, admin_key: String, extra_ports: Vec, public_ipv4: bool, @@ -478,7 +476,6 @@ impl From for NewVMRequest { fn from(req: snp_proto::NewVmReq) -> Self { Self { uuid: req.uuid, - hostname: req.hostname, admin_key: req.admin_pubkey, extra_ports: req.extra_ports.iter().map(|&port| port as u16).collect(), public_ipv4: req.public_ipv4, @@ -639,7 +636,6 @@ impl VM { let vm = VM { uuid: req.uuid, - hostname: req.hostname, admin_key: req.admin_key, nics: vm_nics, vcpus: req.vcpus, @@ -803,8 +799,8 @@ impl VM { i += 1; } let admin_key = format!("detee_admin={} ", self.admin_key); - let hostname = format!("detee_name={}", self.hostname); - format!("{}{}{}", ip_string, admin_key, hostname) + let uuid = format!("detee_uuid={}", self.uuid); + format!("{}{}{}", ip_string, admin_key, uuid) } fn write_config(&self) -> Result<()> {