diff --git a/examples/lamp/src/main.rs b/examples/lamp/src/main.rs index 41adfb4..b28c008 100644 --- a/examples/lamp/src/main.rs +++ b/examples/lamp/src/main.rs @@ -26,6 +26,7 @@ async fn main() { project_root: "./php".into(), ..Default::default() }, + db_size: "2Gi".to_string(), }; // You can choose the type of Topology you want, we suggest starting with the diff --git a/harmony/src/modules/lamp.rs b/harmony/src/modules/lamp.rs index cc69e60..78672f5 100644 --- a/harmony/src/modules/lamp.rs +++ b/harmony/src/modules/lamp.rs @@ -3,6 +3,7 @@ use dockerfile_builder::instruction::{CMD, COPY, ENV, EXPOSE, FROM, RUN, WORKDIR use dockerfile_builder::{Dockerfile, instruction_builder::EnvBuilder}; use non_blank_string_rs::NonBlankString; use serde_json::json; +use std::collections::HashMap; use std::fs; use std::path::{Path, PathBuf}; use std::str::FromStr; @@ -30,6 +31,7 @@ pub struct LAMPScore { pub domain: Url, pub config: LAMPConfig, pub php_version: Version, + pub database_size: String, } #[derive(Debug, Clone, Serialize)] @@ -156,6 +158,11 @@ impl LAMPInterpret { inventory: &Inventory, topology: &T, ) -> Result { + let mut mariadb_overrides = HashMap::new(); + mariadb_overrides.insert( + NonBlankString::from_str("primary.persistence.size").unwrap(), + self.score.database_size.clone(), + ); let score = HelmChartScore { namespace: self.get_namespace(), release_name: NonBlankString::from_str(&format!("{}-database", self.score.name)) @@ -165,7 +172,7 @@ impl LAMPInterpret { ) .unwrap(), chart_version: None, - values_overrides: None, + values_overrides: Some(mariadb_overrides), create_namespace: true, install_only: true, values_yaml: None,