From 58916f6e8acc68046b968e5e2883c2b0a9525021 Mon Sep 17 00:00:00 2001 From: Siegfried Weber Date: Tue, 31 Oct 2023 10:22:37 +0100 Subject: [PATCH 1/2] Upgrade Vector to version 0.33.0 in the tests --- .../kuttl/logging/03-install-airflow-vector-aggregator.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/templates/kuttl/logging/03-install-airflow-vector-aggregator.yaml b/tests/templates/kuttl/logging/03-install-airflow-vector-aggregator.yaml index aa1b667d..9021a6c9 100644 --- a/tests/templates/kuttl/logging/03-install-airflow-vector-aggregator.yaml +++ b/tests/templates/kuttl/logging/03-install-airflow-vector-aggregator.yaml @@ -5,7 +5,7 @@ commands: - script: >- helm install airflow-vector-aggregator vector --namespace $NAMESPACE - --version 0.23.0 + --version 0.26.0 --repo https://helm.vector.dev --values airflow-vector-aggregator-values.yaml --- From f68b9b03d94cd169265f29112b17d86d87b899d7 Mon Sep 17 00:00:00 2001 From: Siegfried Weber Date: Tue, 31 Oct 2023 10:33:45 +0100 Subject: [PATCH 2/2] Fix clippy warnings --- rust/operator-binary/src/airflow_controller.rs | 9 +-------- rust/operator-binary/src/product_logging.rs | 13 +++++++------ 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/rust/operator-binary/src/airflow_controller.rs b/rust/operator-binary/src/airflow_controller.rs index fc8842e3..1e5f9f2d 100644 --- a/rust/operator-binary/src/airflow_controller.rs +++ b/rust/operator-binary/src/airflow_controller.rs @@ -1189,14 +1189,7 @@ fn build_template_envs( airflow: &AirflowCluster, env_overrides: &HashMap, ) -> Vec { - let secret_prop = Some( - airflow - .spec - .cluster_config - .credentials_secret - .as_str() - .clone(), - ); + let secret_prop = Some(airflow.spec.cluster_config.credentials_secret.as_str()); let mut env = secret_prop .map(|secret| { diff --git a/rust/operator-binary/src/product_logging.rs b/rust/operator-binary/src/product_logging.rs index 7fb8f168..137c646c 100644 --- a/rust/operator-binary/src/product_logging.rs +++ b/rust/operator-binary/src/product_logging.rs @@ -1,4 +1,4 @@ -use std::fmt::Display; +use std::fmt::{Display, Write}; use snafu::{OptionExt, ResultExt, Snafu}; use stackable_airflow_crd::STACKABLE_LOG_DIR; @@ -122,16 +122,17 @@ fn create_airflow_config(log_config: &AutomaticContainerLogConfig, log_dir: &str .loggers .iter() .filter(|(name, _)| name.as_str() != AutomaticContainerLogConfig::ROOT_LOGGER) - .map(|(name, config)| { - format!( + .fold(String::new(), |mut output, (name, config)| { + let _ = writeln!( + output, " LOGGING_CONFIG['loggers'].setdefault('{name}', {{ 'propagate': True }}) LOGGING_CONFIG['loggers']['{name}']['level'] = {level} ", level = config.level.to_python_expression() - ) - }) - .collect::(); + ); + output + }); format!( "\