Serve command #27
+2
-4
@@ -2,16 +2,14 @@ use crete::cluster::Cluster;
|
||||
use crete::environment::configure_environment;
|
||||
use ipxe::IPXE_DIR;
|
||||
use minijinja::{Environment, context};
|
||||
use regex::Regex;
|
||||
use regex::regex;
|
||||
|
||||
// TODO: Make this a proper async function
|
||||
pub fn get_file(
|
||||
filename: impl ToString,
|
||||
http_url: impl ToString,
|
||||
) -> impl Future<Output = Option<(Vec<u8>, &'static str)>> {
|
||||
// TODO: Make this a static that is initialized once
|
||||
let re =
|
||||
Regex::new(r"^talos/(?<cluster>.+)/(?<node>.+)\.ya?ml$").expect("regex should be valid");
|
||||
let re = regex!(r"^talos/(?<cluster>.+)/(?<node>.+)\.ya?ml$");
|
||||
|
||||
let filename: String = filename.to_string();
|
||||
let re = re.clone();
|
||||
|
||||
Reference in New Issue
Block a user