Skip to content

Commit 0882c61

Browse files
authored
chore: Remove hardcoded uid and gid (#801)
1 parent 4c7019f commit 0882c61

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 @@ All notable changes to this project will be documented in this file.
2525
- BREAKING: Inject the vector aggregator address into the vector config using the env var `VECTOR_AGGREGATOR_ADDRESS` instead
2626
of having the operator write it to the vector config ([#772]).
2727
- test: Bump to Vector `0.46.1` ([#789]).
28+
- BREAKING: Previously this operator would hardcode the UID and GID of the Pods being created to 1000/0, this has changed now ([#801])
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

@@ -47,6 +51,7 @@ All notable changes to this project will be documented in this file.
4751
[#787]: https://github.com/stackabletech/nifi-operator/pull/787
4852
[#789]: https://github.com/stackabletech/nifi-operator/pull/789
4953
[#799]: https://github.com/stackabletech/nifi-operator/pull/799
54+
[#801]: https://github.com/stackabletech/nifi-operator/pull/801
5055

5156
## [25.3.0] - 2025-03-21
5257

rust/operator-binary/src/controller.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ use crate::{
107107

108108
pub const NIFI_CONTROLLER_NAME: &str = "nificluster";
109109
pub const NIFI_FULL_CONTROLLER_NAME: &str = concatcp!(NIFI_CONTROLLER_NAME, '.', OPERATOR_NAME);
110-
pub const NIFI_UID: i64 = 1000;
111110

112111
const DOCKER_IMAGE_BASE_NAME: &str = "nifi";
113112

@@ -1366,13 +1365,7 @@ async fn build_node_rolegroup_statefulset(
13661365
})
13671366
.context(AddVolumeSnafu)?
13681367
.service_account_name(service_account_name)
1369-
.security_context(
1370-
PodSecurityContextBuilder::new()
1371-
.run_as_user(NIFI_UID)
1372-
.run_as_group(0)
1373-
.fs_group(1000)
1374-
.build(),
1375-
);
1368+
.security_context(PodSecurityContextBuilder::new().fs_group(1000).build());
13761369

13771370
let mut labels = BTreeMap::new();
13781371
labels.insert(

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

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ use stackable_operator::{
4949
};
5050

5151
use crate::{
52-
controller::{NIFI_UID, build_recommended_labels},
52+
controller::build_recommended_labels,
5353
crd::{APP_NAME, HTTPS_PORT, HTTPS_PORT_NAME, METRICS_PORT, NifiRole, v1alpha1},
5454
security::{
5555
authentication::{NifiAuthenticationConfig, STACKABLE_ADMIN_USERNAME},
@@ -345,13 +345,7 @@ fn build_reporting_task_job(
345345
.image_pull_secrets_from_product_image(resolved_product_image)
346346
.restart_policy("OnFailure")
347347
.service_account_name(sa_name)
348-
.security_context(
349-
PodSecurityContextBuilder::new()
350-
.run_as_user(NIFI_UID)
351-
.run_as_group(0)
352-
.fs_group(1000)
353-
.build(),
354-
)
348+
.security_context(PodSecurityContextBuilder::new().fs_group(1000).build())
355349
.add_container(cb.build())
356350
.add_volume(
357351
build_tls_volume(

0 commit comments

Comments
 (0)