Skip to content

Commit 41c8ff1

Browse files
lfranckeadwk67
andauthored
chore: Remove hardcoded uid and gid (#636)
Co-authored-by: Andrew Kenworthy <andrew.kenworthy@stackable.tech>
1 parent 95212ec commit 41c8ff1

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
@@ -26,6 +26,10 @@
2626
- test: Bump OPA to `1.4.2` ([#624]).
2727
- Deprecate airflow `2.10.4` ([#625]).
2828
- Move the git-sync implementation to operator-rs ([#623]). The functionality should not have changed.
29+
- BREAKING: Previously this operator would hardcode the UID and GID of the Pods being created to 1000/0, this has changed now ([#636])
30+
- The `runAsUser` and `runAsGroup` fields will not be set anymore by the operator
31+
- The defaults from the docker images itself will now apply, which will be different from 1000/0 going forward
32+
- This is marked as breaking because tools and policies might exist, which require these fields to be set
2933

3034
### Fixed
3135

@@ -43,6 +47,7 @@
4347
[#624]: https://github.com/stackabletech/airflow-operator/pull/624
4448
[#625]: https://github.com/stackabletech/airflow-operator/pull/625
4549
[#630]: https://github.com/stackabletech/airflow-operator/pull/630
50+
[#636]: https://github.com/stackabletech/airflow-operator/pull/636
4651

4752
## [25.3.0] - 2025-03-21
4853

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)?;
@@ -1238,13 +1232,7 @@ fn build_executor_template_config_map(
12381232
.affinity(&merged_executor_config.affinity)
12391233
.service_account_name(sa_name)
12401234
.restart_policy("Never")
1241-
.security_context(
1242-
PodSecurityContextBuilder::new()
1243-
.run_as_user(AIRFLOW_UID)
1244-
.run_as_group(0)
1245-
.fs_group(1000)
1246-
.build(),
1247-
);
1235+
.security_context(PodSecurityContextBuilder::new().fs_group(1000).build());
12481236

12491237
add_executor_graceful_shutdown_config(merged_executor_config, &mut pb)
12501238
.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)