feat: started to prepare inventory / topoplogy for NCD #1
| @ -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()); | ||||
| } | ||||
|  | ||||
| @ -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, | ||||
|                 }, | ||||
|             ] | ||||
|         ); | ||||
|     } | ||||
| } | ||||
|  | ||||
| @ -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 | ||||
|             ), | ||||
|         )) | ||||
|     } | ||||
|  | ||||
| @ -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; | ||||
|  | ||||
| @ -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() | ||||
|                 )), | ||||
|             ), | ||||
|         } | ||||
|     } | ||||
|  | ||||
| @ -1223,7 +1223,7 @@ pub struct Host { | ||||
|     pub rr: String, | ||||
|     pub mxprio: MaybeString, | ||||
|     pub mx: MaybeString, | ||||
|     pub ttl: MaybeString, | ||||
|     pub ttl: Option<MaybeString>, | ||||
|     pub server: String, | ||||
|     pub description: Option<String>, | ||||
| } | ||||
| @ -1238,7 +1238,7 @@ impl Host { | ||||
|             rr, | ||||
|             server, | ||||
|             mxprio: MaybeString::default(), | ||||
|             ttl: MaybeString::default(), | ||||
|             ttl: Some(MaybeString::default()), | ||||
|             mx: MaybeString::default(), | ||||
|             description: None, | ||||
|         } | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user