chore: added default mariadb size and pass env variables to php app #28
@ -37,7 +37,7 @@ pub struct LAMPScore {
|
|||||||
pub struct LAMPConfig {
|
pub struct LAMPConfig {
|
||||||
pub project_root: PathBuf,
|
pub project_root: PathBuf,
|
||||||
pub ssl_enabled: bool,
|
pub ssl_enabled: bool,
|
||||||
pub database_size: String,
|
pub database_size: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for LAMPConfig {
|
impl Default for LAMPConfig {
|
||||||
@ -45,7 +45,7 @@ impl Default for LAMPConfig {
|
|||||||
LAMPConfig {
|
LAMPConfig {
|
||||||
project_root: Path::new("./src").to_path_buf(),
|
project_root: Path::new("./src").to_path_buf(),
|
||||||
ssl_enabled: true,
|
ssl_enabled: true,
|
||||||
database_size: "2Gi".to_string(),
|
database_size: None,
|
||||||
|
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -159,11 +159,13 @@ impl LAMPInterpret {
|
|||||||
inventory: &Inventory,
|
inventory: &Inventory,
|
||||||
topology: &T,
|
topology: &T,
|
||||||
) -> Result<Outcome, InterpretError> {
|
) -> Result<Outcome, InterpretError> {
|
||||||
let mut mariadb_overrides = HashMap::new();
|
let mut values_overrides = HashMap::new();
|
||||||
mariadb_overrides.insert(
|
if let Some(database_size) = self.score.config.database_size.clone() {
|
||||||
|
values_overrides.insert(
|
||||||
NonBlankString::from_str("primary.persistence.size").unwrap(),
|
NonBlankString::from_str("primary.persistence.size").unwrap(),
|
||||||
self.score.config.database_size.clone(),
|
database_size,
|
||||||
);
|
);
|
||||||
|
}
|
||||||
let score = HelmChartScore {
|
let score = HelmChartScore {
|
||||||
namespace: self.get_namespace(),
|
namespace: self.get_namespace(),
|
||||||
release_name: NonBlankString::from_str(&format!("{}-database", self.score.name))
|
release_name: NonBlankString::from_str(&format!("{}-database", self.score.name))
|
||||||
@ -173,7 +175,7 @@ impl LAMPInterpret {
|
|||||||
)
|
)
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
chart_version: None,
|
chart_version: None,
|
||||||
values_overrides: Some(mariadb_overrides),
|
values_overrides: Some(values_overrides),
|
||||||
create_namespace: true,
|
create_namespace: true,
|
||||||
install_only: true,
|
install_only: true,
|
||||||
values_yaml: None,
|
values_yaml: None,
|
||||||
@ -181,7 +183,6 @@ impl LAMPInterpret {
|
|||||||
|
|
||||||
score.create_interpret().execute(inventory, topology).await
|
score.create_interpret().execute(inventory, topology).await
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_dockerfile(&self, score: &LAMPScore) -> Result<PathBuf, Box<dyn std::error::Error>> {
|
fn build_dockerfile(&self, score: &LAMPScore) -> Result<PathBuf, Box<dyn std::error::Error>> {
|
||||||
let mut dockerfile = Dockerfile::new();
|
let mut dockerfile = Dockerfile::new();
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user
Maintenant que je vois ca je pense que ca devrait etre un Option qui est None par default pour deleguer la tache de set le default a la helm chart. Comme ca nos utilisateurs n'auront pas de surprise et c'est un detail de moins a gerer par nous-meme.
Par exemple, si dans 10 ans le default est rendu a 100G parce que la structure de la BD a change ou je sais pas quoi, on n'aura pas besoin de s'en occuper nous-memes.