Skip to content

Commit aaedc28

Browse files
[DPE-5544] - fix: set dir permissions & remove lost+found on storageattached (#144)
1 parent 74f8644 commit aaedc28

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/events/broker.py

+9
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
PEER,
3939
PROFILE_TESTING,
4040
REL_NAME,
41+
STORAGE,
4142
USER,
4243
Status,
4344
)
@@ -350,6 +351,14 @@ def _on_storage_attached(self, event: StorageAttachedEvent) -> None:
350351
]
351352
)
352353

354+
if self.charm.substrate == "k8s":
355+
self.workload.exec(
356+
["chown", "-R", f"{USER}:{GROUP}", f"{self.workload.paths.data_path}/{STORAGE}"]
357+
)
358+
self.workload.exec(
359+
["rm", "-rf", f"{self.workload.paths.data_path}/{STORAGE}/lost+found"]
360+
)
361+
353362
# checks first whether the broker is active before warning
354363
if self.workload.active():
355364
# new dirs won't be used until topic partitions are assigned to it

0 commit comments

Comments
 (0)