From e8c4615cfbefce4a0a506d97da8c353f50f0c764 Mon Sep 17 00:00:00 2001
From: ykyr <yurii.kyrychynskyi@gmail.com>
Date: Thu, 7 Mar 2024 21:27:08 +0100
Subject: [PATCH] fix: entrypoint ARGS remove new line

---
 entrypoint.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/entrypoint.sh b/entrypoint.sh
index e5394e7..4ce09ea 100755
--- a/entrypoint.sh
+++ b/entrypoint.sh
@@ -94,6 +94,8 @@ EOF
 # https://github.com/GoogleContainerTools/kaniko/issues/1803
 # https://github.com/GoogleContainerTools/kaniko/issues/1349
 export IFS=''
+# Removes a trailing new line
+ARGS=$(echo "${ARGS}" | sed 's/\n*$//')
 kaniko_cmd="/kaniko/executor ${ARGS} --reproducible --force"
 echo "Running kaniko command ${kaniko_cmd}"
 eval "${kaniko_cmd}"