Skip to content

Commit e51b0b8

Browse files
committed
chore: Remove hardcoded uid and gid
1 parent d24fb5d commit e51b0b8

File tree

3 files changed

+8
-16
lines changed

3 files changed

+8
-16
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
- test: Bump OPA to `1.4.2` ([#624]).
2626
- Deprecate airflow `2.10.4` ([#625]).
2727
- Move the git-sync implementation to operator-rs ([#623]). The functionality should not have changed.
28+
- BREAKING: Previously this operator would hardcode the UID and GID of the Pods being created to 1000/0, this has changed now ([#636])
29+
- The `runAsUser` and `runAsGroup` fields will not be set anymore by the operator
30+
- The defaults from the docker images itself will now apply, which will be different from 1000/0 going forward
31+
- This is marked as breaking because tools and policies might exist, which require these fields to be set
2832

2933
### Fixed
3034

@@ -41,6 +45,7 @@
4145
[#623]: https://github.com/stackabletech/airflow-operator/pull/623
4246
[#624]: https://github.com/stackabletech/airflow-operator/pull/624
4347
[#625]: https://github.com/stackabletech/airflow-operator/pull/625
48+
[#636]: https://github.com/stackabletech/airflow-operator/pull/636
4449

4550
## [25.3.0] - 2025-03-21
4651

rust/operator-binary/src/airflow_controller.rs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ use crate::{
8181
config::{self, PYTHON_IMPORTS},
8282
controller_commons::{self, CONFIG_VOLUME_NAME, LOG_CONFIG_VOLUME_NAME, LOG_VOLUME_NAME},
8383
crd::{
84-
self, AIRFLOW_CONFIG_FILENAME, AIRFLOW_UID, APP_NAME, AirflowClusterStatus, AirflowConfig,
84+
self, AIRFLOW_CONFIG_FILENAME, APP_NAME, AirflowClusterStatus, AirflowConfig,
8585
AirflowConfigOptions, AirflowExecutor, AirflowRole, CONFIG_PATH, Container, ExecutorConfig,
8686
ExecutorConfigFragment, HTTP_PORT, HTTP_PORT_NAME, LISTENER_VOLUME_DIR,
8787
LISTENER_VOLUME_NAME, LOG_CONFIG_DIR, METRICS_PORT, METRICS_PORT_NAME, OPERATOR_NAME,
@@ -936,13 +936,7 @@ fn build_server_rolegroup_statefulset(
936936
.image_pull_secrets_from_product_image(resolved_product_image)
937937
.affinity(&merged_airflow_config.affinity)
938938
.service_account_name(service_account.name_any())
939-
.security_context(
940-
PodSecurityContextBuilder::new()
941-
.run_as_user(AIRFLOW_UID)
942-
.run_as_group(0)
943-
.fs_group(1000)
944-
.build(),
945-
);
939+
.security_context(PodSecurityContextBuilder::new().fs_group(1000).build());
946940

947941
let mut airflow_container = ContainerBuilder::new(&Container::Airflow.to_string())
948942
.context(InvalidContainerNameSnafu)?;
@@ -1233,13 +1227,7 @@ fn build_executor_template_config_map(
12331227
.affinity(&merged_executor_config.affinity)
12341228
.service_account_name(sa_name)
12351229
.restart_policy("Never")
1236-
.security_context(
1237-
PodSecurityContextBuilder::new()
1238-
.run_as_user(AIRFLOW_UID)
1239-
.run_as_group(0)
1240-
.fs_group(1000)
1241-
.build(),
1242-
);
1230+
.security_context(PodSecurityContextBuilder::new().fs_group(1000).build());
12431231

12441232
add_executor_graceful_shutdown_config(merged_executor_config, &mut pb)
12451233
.context(GracefulShutdownSnafu)?;

rust/operator-binary/src/crd/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ pub mod affinity;
5757
pub mod authentication;
5858
pub mod authorization;
5959

60-
pub const AIRFLOW_UID: i64 = 1000;
6160
pub const APP_NAME: &str = "airflow";
6261
pub const OPERATOR_NAME: &str = "airflow.stackable.tech";
6362
pub const CONFIG_PATH: &str = "/stackable/app/config";

0 commit comments

Comments
 (0)