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