Skip to content

Commit 17c7af8

Browse files
committed
chore: Remove hardcoded uid and gid
1 parent 2406e44 commit 17c7af8

File tree

5 files changed

+6
-15
lines changed

5 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 ([#589]).
2424
- test: Bump to Vector `0.46.1` ([#599]).
25+
- BREAKING: Previously this operator would hardcode the UID and GID of the Pods being created to 1000/0, this has changed now ([#603])
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

@@ -34,6 +38,7 @@ All notable changes to this project will be documented in this file.
3438
[#592]: https://github.com/stackabletech/hive-operator/pull/592
3539
[#596]: https://github.com/stackabletech/hive-operator/pull/596
3640
[#599]: https://github.com/stackabletech/hive-operator/pull/599
41+
[#603]: https://github.com/stackabletech/hive-operator/pull/603
3742

3843
## [25.3.0] - 2025-03-21
3944

rust/operator-binary/src/controller.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,6 @@ use crate::{
100100
pub const HIVE_CONTROLLER_NAME: &str = "hivecluster";
101101
pub const HIVE_FULL_CONTROLLER_NAME: &str = concatcp!(HIVE_CONTROLLER_NAME, '.', OPERATOR_NAME);
102102

103-
/// Used as runAsUser in the pod security context
104-
pub const HIVE_UID: i64 = 1000;
105103
const DOCKER_IMAGE_BASE_NAME: &str = "hive";
106104

107105
pub const MAX_HIVE_LOG_FILES_SIZE: MemoryQuantity = MemoryQuantity {
@@ -986,13 +984,7 @@ fn build_metastore_rolegroup_statefulset(
986984
.context(AddVolumeSnafu)?
987985
.affinity(&merged_config.affinity)
988986
.service_account_name(sa_name)
989-
.security_context(
990-
PodSecurityContextBuilder::new()
991-
.run_as_user(HIVE_UID)
992-
.run_as_group(0)
993-
.fs_group(1000)
994-
.build(),
995-
);
987+
.security_context(PodSecurityContextBuilder::new().fs_group(1000).build());
996988

997989
if let Some(ContainerLogConfig {
998990
choice:

tests/templates/kuttl/kerberos-hdfs/35-access-hdfs.yaml.j2

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

tests/templates/kuttl/kerberos-hdfs/70-install-access-hive.yaml.j2

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ commands:
5555
storage: "1"
5656
securityContext:
5757
fsGroup: 1000
58-
runAsGroup: 1000
59-
runAsUser: 1000
6058
restartPolicy: OnFailure
6159
EOF
6260
---

tests/templates/kuttl/kerberos-s3/70-install-access-hive.yaml.j2

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ commands:
5555
storage: "1"
5656
securityContext:
5757
fsGroup: 1000
58-
runAsGroup: 1000
59-
runAsUser: 1000
6058
restartPolicy: OnFailure
6159
EOF
6260
---

0 commit comments

Comments
 (0)