Skip to content

chore: Remove hardcoded uid and gid #683

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

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

### Fixed

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

## [25.3.0] - 2025-03-21

Expand Down
2 changes: 0 additions & 2 deletions rust/operator-binary/src/crd/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,3 @@ pub const DATANODE_ROOT_DATA_DIR_SUFFIX: &str = "/datanode";

pub const LISTENER_VOLUME_NAME: &str = "listener";
pub const LISTENER_VOLUME_DIR: &str = "/stackable/listener";

pub const HDFS_UID: i64 = 1000;
8 changes: 1 addition & 7 deletions rust/operator-binary/src/hdfs_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -827,13 +827,7 @@ fn rolegroup_statefulset(
.image_pull_secrets_from_product_image(resolved_product_image)
.affinity(&merged_config.affinity)
.service_account_name(service_account.name_any())
.security_context(
PodSecurityContextBuilder::new()
.run_as_user(HDFS_UID)
.run_as_group(0)
.fs_group(1000)
.build(),
);
.security_context(PodSecurityContextBuilder::new().fs_group(1000).build());

// Adds all containers and volumes to the pod builder
// We must use the selector labels ("rolegroup_selector_labels") and not the recommended labels
Expand Down
2 changes: 0 additions & 2 deletions tests/templates/kuttl/kerberos/30-access-hdfs.txt.j2
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,4 @@ spec:
storage: "1"
securityContext:
fsGroup: 1000
runAsGroup: 1000
runAsUser: 1000
restartPolicy: OnFailure
2 changes: 0 additions & 2 deletions tests/templates/kuttl/kerberos/32-check-file.txt.j2
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,4 @@ spec:
storage: "1"
securityContext:
fsGroup: 1000
runAsGroup: 1000
runAsUser: 1000
restartPolicy: OnFailure
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,5 @@ commands:
storage: "1"
securityContext:
fsGroup: 1000
runAsGroup: 1000
runAsUser: 1000
restartPolicy: OnFailure
EOF
Loading