Skip to content

Commit 56ebcd6

Browse files
adwk67claude
andcommitted
refactor: simplify build_airflow_template_envs signature
Replace the &ExecutorConfig parameter with a plain bool (vector_agent_enabled) — the function only ever read config.logging.enable_vector_agent from it. This decouples the function from the ExecutorConfig type, allowing the new controller to call it with a pre-validated bool without needing to reconstruct an ExecutorConfig. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e231737 commit 56ebcd6

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

rust/operator-binary/src/airflow_controller.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1340,7 +1340,7 @@ fn build_executor_template_config_map(
13401340
.add_env_vars(build_airflow_template_envs(
13411341
airflow,
13421342
env_overrides,
1343-
merged_executor_config,
1343+
merged_executor_config.logging.enable_vector_agent,
13441344
metadata_database_connection_details,
13451345
git_sync_resources,
13461346
resolved_product_image,

rust/operator-binary/src/env_vars.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ use stackable_operator::{
1818

1919
use crate::{
2020
crd::{
21-
AirflowExecutor, AirflowRole, ExecutorConfig, LOG_CONFIG_DIR, STACKABLE_LOG_DIR,
22-
TEMPLATE_LOCATION, TEMPLATE_NAME,
21+
AirflowExecutor, AirflowRole, LOG_CONFIG_DIR, STACKABLE_LOG_DIR, TEMPLATE_LOCATION,
22+
TEMPLATE_NAME,
2323
authentication::{
2424
AirflowAuthenticationClassResolved, AirflowClientAuthenticationDetailsResolved,
2525
},
@@ -373,10 +373,11 @@ fn static_envs(
373373

374374
/// Return environment variables to be applied to the configuration map used in conjunction with
375375
/// the `kubernetesExecutor` worker.
376+
// REVIEW: simplified from &ExecutorConfig — only config.logging.enable_vector_agent was used
376377
pub fn build_airflow_template_envs(
377378
airflow: &v1alpha2::AirflowCluster,
378379
env_overrides: &HashMap<String, String>,
379-
config: &ExecutorConfig,
380+
vector_agent_enabled: bool,
380381
metadata_database_connection_details: &SqlAlchemyDatabaseConnectionDetails,
381382
git_sync_resources: &git_sync::v1alpha2::GitSyncResources,
382383
resolved_product_image: &ResolvedProductImage,
@@ -434,7 +435,7 @@ pub fn build_airflow_template_envs(
434435
// _STACKABLE_POST_HOOK will contain a command to create a shutdown hook that will be
435436
// evaluated in the wrapper for each stackable spark container: this is necessary for pods
436437
// that are created and then terminated (we do a similar thing for spark-k8s).
437-
if config.logging.enable_vector_agent {
438+
if vector_agent_enabled {
438439
env.insert(
439440
"_STACKABLE_POST_HOOK".into(),
440441
EnvVar {

0 commit comments

Comments
 (0)