Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion rust/crd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,8 @@ impl SupersetConfig {
logging: product_logging::spec::default_logging(),
affinity: get_affinity(cluster_name, role),
graceful_shutdown_timeout: Some(DEFAULT_NODE_GRACEFUL_SHUTDOWN_TIMEOUT),
..Default::default()
row_limit: None,
webserver_timeout: None,
}
}
}
Expand Down
23 changes: 23 additions & 0 deletions rust/operator-binary/src/superset_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
use std::{
borrow::Cow,
collections::{BTreeMap, BTreeSet, HashMap},
io::Write,
sync::Arc,
};

Expand Down Expand Up @@ -250,6 +251,11 @@ pub enum Error {
AddTlsVolumesAndVolumeMounts {
source: stackable_operator::commons::authentication::tls::TlsClientDetailsError,
},

#[snafu(display(
"failed to write to String (Vec<u8> to be precise) containing superset config"
))]
WriteToConfigFileString { source: std::io::Error },
}

type Result<T, E = Error> = std::result::Result<T, E>;
Expand Down Expand Up @@ -523,6 +529,16 @@ fn build_rolegroup_config_map(
);

let mut config_file = Vec::new();

// By removing the key from `config_properties`, we avoid pasting the Python code into a Python variable as well
// (which would be bad)
// TODO: Use public constants in operator-rs to reference `EXPERIMENTAL_FILE_HEADER` and `EXPERIMENTAL_FILE_FOOTER`
if let Some(header) = config_properties.remove("EXPERIMENTAL_FILE_HEADER") {
writeln!(config_file, "{}", header).context(WriteToConfigFileStringSnafu)?;
}
// removing key from `config_properties` to avoid key value match. Append it later.
let temp_file_footer = config_properties.remove("EXPERIMENTAL_FILE_FOOTER");

flask_app_config_writer::write::<SupersetConfigOptions, _, _>(
&mut config_file,
config_properties.iter(),
Expand All @@ -532,6 +548,13 @@ fn build_rolegroup_config_map(
rolegroup: rolegroup.clone(),
})?;

// By removing the key from `config_properties`, we avoid pasting the Python code into a Python variable as well
// (which would be bad)
// TODO: Use public constants in operator-rs to reference `EXPERIMENTAL_FILE_HEADER` and `EXPERIMENTAL_FILE_FOOTER`
if let Some(footer) = temp_file_footer {
writeln!(config_file, "{}", footer).context(WriteToConfigFileStringSnafu)?;
}

let mut cm_builder = ConfigMapBuilder::new();

cm_builder
Expand Down
Loading