Skip to content

Commit e180515

Browse files
authored
chore: Remove hardcoded uid and gid (#683)
1 parent 44853f7 commit e180515

File tree

6 files changed

+6
-15
lines changed

6 files changed

+6
-15
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ All notable changes to this project will be documented in this file.
2222
- BREAKING: Inject the vector aggregator address into the vector config using the env var `VECTOR_AGGREGATOR_ADDRESS` instead
2323
of having the operator write it to the vector config ([#671]).
2424
- test: Bump to Vector `0.46.1` ([#677]).
25+
- BREAKING: Previously this operator would hardcode the UID and GID of the Pods being created to 1000/0, this has changed now ([#683])
26+
- The `runAsUser` and `runAsGroup` fields will not be set anymore by the operator
27+
- The defaults from the docker images itself will now apply, which will be different from 1000/0 going forward
28+
- This is marked as breaking because tools and policies might exist, which require these fields to be set
2529

2630
### Fixed
2731

@@ -39,6 +43,7 @@ All notable changes to this project will be documented in this file.
3943
[#672]: https://github.com/stackabletech/hdfs-operator/pull/672
4044
[#675]: https://github.com/stackabletech/hdfs-operator/pull/675
4145
[#677]: https://github.com/stackabletech/hdfs-operator/pull/677
46+
[#683]: https://github.com/stackabletech/hdfs-operator/pull/683
4247

4348
## [25.3.0] - 2025-03-21
4449

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,3 @@ pub const DATANODE_ROOT_DATA_DIR_SUFFIX: &str = "/datanode";
8282

8383
pub const LISTENER_VOLUME_NAME: &str = "listener";
8484
pub const LISTENER_VOLUME_DIR: &str = "/stackable/listener";
85-
86-
pub const HDFS_UID: i64 = 1000;

rust/operator-binary/src/hdfs_controller.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -827,13 +827,7 @@ fn rolegroup_statefulset(
827827
.image_pull_secrets_from_product_image(resolved_product_image)
828828
.affinity(&merged_config.affinity)
829829
.service_account_name(service_account.name_any())
830-
.security_context(
831-
PodSecurityContextBuilder::new()
832-
.run_as_user(HDFS_UID)
833-
.run_as_group(0)
834-
.fs_group(1000)
835-
.build(),
836-
);
830+
.security_context(PodSecurityContextBuilder::new().fs_group(1000).build());
837831

838832
// Adds all containers and volumes to the pod builder
839833
// We must use the selector labels ("rolegroup_selector_labels") and not the recommended labels

tests/templates/kuttl/kerberos/30-access-hdfs.txt.j2

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,4 @@ spec:
8686
storage: "1"
8787
securityContext:
8888
fsGroup: 1000
89-
runAsGroup: 1000
90-
runAsUser: 1000
9189
restartPolicy: OnFailure

tests/templates/kuttl/kerberos/32-check-file.txt.j2

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,4 @@ spec:
5858
storage: "1"
5959
securityContext:
6060
fsGroup: 1000
61-
runAsGroup: 1000
62-
runAsUser: 1000
6361
restartPolicy: OnFailure

tests/templates/kuttl/topology-provider/20-access-hdfs.yaml.j2

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,5 @@ commands:
6464
storage: "1"
6565
securityContext:
6666
fsGroup: 1000
67-
runAsGroup: 1000
68-
runAsUser: 1000
6967
restartPolicy: OnFailure
7068
EOF

0 commit comments

Comments
 (0)