From 9154be5228e6bc905984c1e7e6c4cb538a36c762 Mon Sep 17 00:00:00 2001 From: Felix Moessbauer Date: Thu, 13 Feb 2025 14:46:01 +0100 Subject: [PATCH] Revert "container: Disable git safe.directory when running without kas-container" This reverts commit 06aae60b658eb38e2162d153ef3aa0fa59c0e2ca. As we now handle the git safe dir part in kas, we no longer need the global exclusion in the entrypoint. Signed-off-by: Felix Moessbauer --- container-entrypoint | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/container-entrypoint b/container-entrypoint index b9a2f7ca..41ce89d8 100755 --- a/container-entrypoint +++ b/container-entrypoint @@ -35,15 +35,8 @@ may also need to update the host distribution (e.g. Debian Jessie -> Stretch). EOF fi -if [ -z "$USER_ID" ]; then - # Not a kas-container call - GOSU="" - - # Work around gitlab-runner not aligning checked out repo ownership - # with our builder user - sudo git config --system safe.directory "*" -elif [ "$USER_ID" = 0 ]; then - # We shall run everything as root +if [ -z "$USER_ID" ] || [ "$USER_ID" = 0 ]; then + # Not a kas-container call, or we shall run everything as root GOSU="" else GROUP_ID=${GROUP_ID:-$(id -g)}