diff --git a/examples/lamp/src/main.rs b/examples/lamp/src/main.rs index 1aaca90..f26daaa 100644 --- a/examples/lamp/src/main.rs +++ b/examples/lamp/src/main.rs @@ -8,7 +8,7 @@ use harmony::{ #[tokio::main] async fn main() { - // This here is the whole configuration to + // This here is the whole configuration to // - setup a local K3D cluster // - Build a docker image with the PHP project builtin and production grade settings // - Deploy a mariadb database using a production grade helm chart diff --git a/harmony/src/domain/config.rs b/harmony/src/domain/config.rs index 0fa059f..53d7446 100644 --- a/harmony/src/domain/config.rs +++ b/harmony/src/domain/config.rs @@ -6,8 +6,8 @@ lazy_static! { .unwrap() .data_dir() .join("harmony"); - pub static ref REGISTRY_URL: String = std::env::var("HARMONY_REGISTRY_URL") - .unwrap_or_else(|_| "hub.nationtech.io".to_string()); + pub static ref REGISTRY_URL: String = + std::env::var("HARMONY_REGISTRY_URL").unwrap_or_else(|_| "hub.nationtech.io".to_string()); pub static ref REGISTRY_PROJECT: String = std::env::var("HARMONY_REGISTRY_PROJECT").unwrap_or_else(|_| "harmony".to_string()); } diff --git a/harmony/src/infra/opnsense/load_balancer.rs b/harmony/src/infra/opnsense/load_balancer.rs index dd32a03..cae414a 100644 --- a/harmony/src/infra/opnsense/load_balancer.rs +++ b/harmony/src/infra/opnsense/load_balancer.rs @@ -370,10 +370,13 @@ mod tests { let result = get_servers_for_backend(&backend, &haproxy); // Check the result - assert_eq!(result, vec![BackendServer { - address: "192.168.1.1".to_string(), - port: 80, - },]); + assert_eq!( + result, + vec![BackendServer { + address: "192.168.1.1".to_string(), + port: 80, + },] + ); } #[test] fn test_get_servers_for_backend_no_linked_servers() { @@ -430,15 +433,18 @@ mod tests { // Call the function let result = get_servers_for_backend(&backend, &haproxy); // Check the result - assert_eq!(result, vec![ - BackendServer { - address: "some-hostname.test.mcd".to_string(), - port: 80, - }, - BackendServer { - address: "192.168.1.2".to_string(), - port: 8080, - }, - ]); + assert_eq!( + result, + vec![ + BackendServer { + address: "some-hostname.test.mcd".to_string(), + port: 80, + }, + BackendServer { + address: "192.168.1.2".to_string(), + port: 8080, + }, + ] + ); } } diff --git a/harmony/src/modules/dhcp.rs b/harmony/src/modules/dhcp.rs index c6cc5f7..0112b41 100644 --- a/harmony/src/modules/dhcp.rs +++ b/harmony/src/modules/dhcp.rs @@ -166,7 +166,11 @@ impl DhcpInterpret { InterpretStatus::SUCCESS, format!( "Dhcp Interpret Set next boot to [{:?}], boot_filename to [{:?}], filename to [{:?}], filename64 to [{:?}], filenameipxe to [:{:?}]", - self.score.boot_filename, self.score.boot_filename, self.score.filename, self.score.filename64, self.score.filenameipxe + self.score.boot_filename, + self.score.boot_filename, + self.score.filename, + self.score.filename64, + self.score.filenameipxe ), )) } diff --git a/harmony/src/modules/mod.rs b/harmony/src/modules/mod.rs index 90c224d..6a615c5 100644 --- a/harmony/src/modules/mod.rs +++ b/harmony/src/modules/mod.rs @@ -3,6 +3,7 @@ pub mod dns; pub mod dummy; pub mod helm; pub mod http; +pub mod ipxe; pub mod k3d; pub mod k8s; pub mod lamp; @@ -10,4 +11,3 @@ pub mod load_balancer; pub mod okd; pub mod opnsense; pub mod tftp; -pub mod ipxe; diff --git a/harmony/src/modules/okd/bootstrap_dhcp.rs b/harmony/src/modules/okd/bootstrap_dhcp.rs index b2386af..c133ecf 100644 --- a/harmony/src/modules/okd/bootstrap_dhcp.rs +++ b/harmony/src/modules/okd/bootstrap_dhcp.rs @@ -46,7 +46,10 @@ impl OKDBootstrapDhcpScore { None, // To allow UEFI boot we cannot provide a legacy file Some("undionly.kpxe".to_string()), Some("ipxe.efi".to_string()), - Some(format!("http://{}:8080/boot.ipxe", topology.router.get_gateway())), + Some(format!( + "http://{}:8080/boot.ipxe", + topology.router.get_gateway() + )), ), } } diff --git a/opnsense-config-xml/src/data/opnsense.rs b/opnsense-config-xml/src/data/opnsense.rs index aec4a51..be3e9af 100644 --- a/opnsense-config-xml/src/data/opnsense.rs +++ b/opnsense-config-xml/src/data/opnsense.rs @@ -1223,7 +1223,7 @@ pub struct Host { pub rr: String, pub mxprio: MaybeString, pub mx: MaybeString, - pub ttl: MaybeString, + pub ttl: Option, pub server: String, pub description: Option, } @@ -1238,7 +1238,7 @@ impl Host { rr, server, mxprio: MaybeString::default(), - ttl: MaybeString::default(), + ttl: Some(MaybeString::default()), mx: MaybeString::default(), description: None, }