From 28a4dc70334d8a00a0e48f8003628e0c25308044 Mon Sep 17 00:00:00 2001 From: Enric Tejedor Saavedra Date: Tue, 3 Dec 2024 11:50:14 +0100 Subject: [PATCH] [swan-cern] Sidecar container needs to run as root When using the swan-cern user image, by default jovyan is used. This commits forces the use of root. --- swan-cern/files/swan_config_cern.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/swan-cern/files/swan_config_cern.py b/swan-cern/files/swan_config_cern.py index 1dd3f92..05afbd8 100644 --- a/swan-cern/files/swan_config_cern.py +++ b/swan-cern/files/swan_config_cern.py @@ -12,6 +12,7 @@ V1ObjectMeta, V1Secret, V1SecretVolumeSource, + V1SecurityContext, V1Volume, V1VolumeMount, ) @@ -200,7 +201,8 @@ def _init_eos_containers(self, eos_secret_name): env['USER_ID'], str(swan_cull_period) ], - volume_mounts=side_container_volume_mounts + volume_mounts=side_container_volume_mounts, + security_context=V1SecurityContext(run_as_user=0) ) )