Skip to content

Commit 218f278

Browse files
committed
chore: Remove hardcoded uid and gid
1 parent 274709a commit 218f278

File tree

4 files changed

+4
-24
lines changed

4 files changed

+4
-24
lines changed

rust/operator-binary/src/kafka_controller.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,6 @@ use crate::{
9797
pub const KAFKA_CONTROLLER_NAME: &str = "kafkacluster";
9898
pub const KAFKA_FULL_CONTROLLER_NAME: &str = concatcp!(KAFKA_CONTROLLER_NAME, '.', OPERATOR_NAME);
9999

100-
/// Used as runAsUser in the pod security context. This is specified in the kafka image file
101-
pub const KAFKA_UID: i64 = 1000;
102-
103100
pub struct Ctx {
104101
pub client: stackable_operator::client::Client,
105102
pub product_config: ProductConfigManager,
@@ -1088,13 +1085,7 @@ fn build_broker_rolegroup_statefulset(
10881085
)
10891086
.context(AddVolumeSnafu)?
10901087
.service_account_name(service_account.name_any())
1091-
.security_context(
1092-
PodSecurityContextBuilder::new()
1093-
.run_as_user(KAFKA_UID)
1094-
.run_as_group(0)
1095-
.fs_group(1000)
1096-
.build(),
1097-
);
1088+
.security_context(PodSecurityContextBuilder::new().fs_group(1000).build());
10981089

10991090
// Add vector container after kafka container to keep the defaulting into kafka container
11001091
if merged_config.logging.enable_vector_agent {

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ spec:
6666
volumeMode: Filesystem
6767
securityContext:
6868
fsGroup: 1000
69-
runAsGroup: 1000
70-
runAsUser: 1000
7169
restartPolicy: OnFailure
7270
---
7371
apiVersion: v1

tests/templates/kuttl/tls/31_test-tls-job.yaml.j2

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,5 @@ spec:
9090
storage: "1"
9191
securityContext:
9292
fsGroup: 1000
93-
runAsGroup: 1000
94-
runAsUser: 1000
9593
serviceAccountName: test-sa
9694
restartPolicy: OnFailure

tests/test-definition.yaml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,10 @@
66
dimensions:
77
- name: kafka
88
values:
9-
- 3.7.2
10-
- 3.9.0
11-
# Alternatively, if you want to use a custom image, append a comma and the full image name to the product version
12-
# as in the example below.
13-
# - 3.8.0,oci.stackable.tech/sdp/kafka:3.8.0-stackable0.0.0-dev
9+
- 3.9.0,localhost:5000/sdp/kafka:3.9.0-stackable0.0.0-dev
1410
- name: kafka-latest
1511
values:
16-
- 3.7.2 # Using LTS version here
17-
# Alternatively, if you want to use a custom image, append a comma and the full image name to the product version
18-
# as in the example below.
19-
# - 3.7.2,oci.stackable.tech/sdp/kafka:3.7.2-stackable0.0.0-dev
12+
- 3.9.0,localhost:5000/sdp/kafka:3.9.0-stackable0.0.0-dev
2013
- name: zookeeper
2114
values:
2215
- 3.9.3
@@ -28,7 +21,7 @@ dimensions:
2821
- 3.7.2
2922
- name: upgrade_new
3023
values:
31-
- 3.9.0
24+
- 3.9.0,localhost:5000/sdp/kafka:3.9.0-stackable0.0.0-dev
3225
- name: use-client-tls
3326
values:
3427
- "true"

0 commit comments

Comments
 (0)