Skip to content

Commit 4b65949

Browse files
committed
fix: consolidate configmap to resource folder, move controller commons to build
1 parent 1b31a10 commit 4b65949

9 files changed

Lines changed: 10 additions & 10 deletions

File tree

rust/operator-binary/src/airflow_controller.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,17 @@ use crate::{
3232
controller::{
3333
ValidatedCluster, ValidatedExecutorTemplate,
3434
build::{
35-
config_map,
3635
resource::{
36+
config_map,
3737
executor::build_executor_template_config_map,
3838
listener::build_group_listener,
3939
pdb::build_pdb,
4040
service::{build_rolegroup_headless_service, build_rolegroup_metrics_service},
4141
statefulset::build_server_rolegroup_statefulset,
4242
},
43+
volumes::LOG_VOLUME_NAME,
4344
},
4445
},
45-
controller_commons::LOG_VOLUME_NAME,
4646
crd::{
4747
APP_NAME, AirflowClusterStatus, AirflowConfigOverrides, Container, OPERATOR_NAME,
4848
internal_secret::{
@@ -128,7 +128,7 @@ pub enum Error {
128128

129129
#[snafu(display("failed to build rolegroup ConfigMap"))]
130130
BuildConfigMap {
131-
source: crate::controller::build::config_map::Error,
131+
source: crate::controller::build::resource::config_map::Error,
132132
},
133133

134134
#[snafu(display("invalid git-sync specification"))]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Builders that assemble Kubernetes resources from the validated cluster.
22
3-
pub mod config_map;
43
pub mod graceful_shutdown;
54
pub mod properties;
65
pub mod resource;
6+
pub mod volumes;

rust/operator-binary/src/controller/build/config_map.rs renamed to rust/operator-binary/src/controller/build/resource/config_map.rs

File renamed without changes.

rust/operator-binary/src/controller/build/resource/executor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ use crate::{
3232
add_authentication_volumes_and_volume_mounts, add_git_sync_resources,
3333
build_logging_container,
3434
},
35+
volumes::{self, CONFIG_VOLUME_NAME, LOG_CONFIG_VOLUME_NAME, LOG_VOLUME_NAME},
3536
},
3637
},
37-
controller_commons::{self, CONFIG_VOLUME_NAME, LOG_CONFIG_VOLUME_NAME, LOG_VOLUME_NAME},
3838
crd::{CONFIG_PATH, Container, LOG_CONFIG_DIR, STACKABLE_LOG_DIR, TEMPLATE_NAME},
3939
};
4040

@@ -149,7 +149,7 @@ pub fn build_executor_template_config_map(
149149
pb.add_container(airflow_container.build());
150150
pb.add_volumes(cluster.volumes().clone())
151151
.context(AddVolumeSnafu)?;
152-
pb.add_volumes(controller_commons::create_volumes(
152+
pb.add_volumes(volumes::create_volumes(
153153
cluster
154154
.resource_names(&executor_role_name(), &executor_role_group_name())
155155
.role_group_config_map()

rust/operator-binary/src/controller/build/resource/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//! Builders for individual Kubernetes resources (one module per resource type).
22
3+
pub mod config_map;
34
pub mod executor;
45
pub mod listener;
56
pub mod pdb;

rust/operator-binary/src/controller/build/resource/pod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use stackable_operator::{
1919
};
2020

2121
use crate::{
22-
controller_commons::{CONFIG_VOLUME_NAME, LOG_VOLUME_NAME},
22+
controller::build::volumes::{CONFIG_VOLUME_NAME, LOG_VOLUME_NAME},
2323
crd::authentication::{
2424
AirflowAuthenticationClassResolved, AirflowClientAuthenticationDetailsResolved,
2525
},

rust/operator-binary/src/controller/build/resource/statefulset.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ use crate::{
4141
},
4242
service::stateful_set_service_name,
4343
},
44+
volumes::{self, CONFIG_VOLUME_NAME, LOG_CONFIG_VOLUME_NAME, LOG_VOLUME_NAME},
4445
},
4546
},
46-
controller_commons::{self, CONFIG_VOLUME_NAME, LOG_CONFIG_VOLUME_NAME, LOG_VOLUME_NAME},
4747
crd::{
4848
AirflowExecutor, AirflowRole, CONFIG_PATH, Container, HTTP_PORT_NAME, LISTENER_PVC_NAME,
4949
LISTENER_VOLUME_DIR, LOG_CONFIG_DIR, METRICS_CONTAINER_NAME, METRICS_PORT,
@@ -300,7 +300,7 @@ pub fn build_server_rolegroup_statefulset(
300300

301301
pb.add_volumes(validated_cluster.volumes().clone())
302302
.context(AddVolumeSnafu)?;
303-
pb.add_volumes(controller_commons::create_volumes(
303+
pb.add_volumes(volumes::create_volumes(
304304
resource_names.role_group_config_map().as_ref(),
305305
&logging.product_container,
306306
))
File renamed without changes.

rust/operator-binary/src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ use crate::{
4040

4141
mod airflow_controller;
4242
mod controller;
43-
mod controller_commons;
4443
mod crd;
4544
mod util;
4645
mod webhooks;

0 commit comments

Comments
 (0)