Files
flux-releaser/crates/flux-releaser/src/services/cluster_list.rs
kjuulh 5ce33b379e
Some checks failed
continuous-integration/drone/push Build is failing
feat: add ability to actually publish
Signed-off-by: kjuulh <contact@kjuulh.io>
2024-05-26 13:37:49 +02:00

24 lines
605 B
Rust

use std::collections::HashMap;
#[derive(Default)]
pub struct ClusterList {}
impl ClusterList {
pub async fn get_list(&self) -> anyhow::Result<HashMap<String, Vec<String>>> {
Ok(HashMap::from([
("dev".into(), vec!["clank-dev".into()]),
("prod".into(), vec!["clank-prod".into()]),
]))
}
pub async fn get(&self, environment: &str) -> anyhow::Result<Option<Vec<String>>> {
let list = self.get_list().await?;
if let Some(x) = list.get(environment) {
Ok(Some(x.clone()))
} else {
Ok(None)
}
}
}