use default database_size None in LampConfig to default to value from helm chart
This commit is contained in:
parent
1c3669cb47
commit
e1133ea114
@ -18,8 +18,8 @@ use crate::{
|
|||||||
data::{Id, Version},
|
data::{Id, Version},
|
||||||
interpret::{Interpret, InterpretError, InterpretName, InterpretStatus, Outcome},
|
interpret::{Interpret, InterpretError, InterpretName, InterpretStatus, Outcome},
|
||||||
inventory::Inventory,
|
inventory::Inventory,
|
||||||
modules::k8s::deployment::K8sDeploymentScore,
|
modules::k8s::deployment::K8sDeploymentScore,
|
||||||
score::Score,
|
score::Score,
|
||||||
topology::{K8sclient, Topology, Url},
|
topology::{K8sclient, Topology, Url},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -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() {
|
||||||
NonBlankString::from_str("primary.persistence.size").unwrap(),
|
values_overrides.insert(
|
||||||
self.score.config.database_size.clone(),
|
NonBlankString::from_str("primary.persistence.size").unwrap(),
|
||||||
);
|
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