kas-container: Add check for KAS_REPO_REF_DIR

Check if KAS_REPO_REF_DIR exists to avoid an error during
the execution of readlink.

Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Quirin Gylstorff 2021-11-05 16:09:24 +01:00 committed by Jan Kiszka
parent 9b9bb00c56
commit 2c0486d846

View File

@ -399,6 +399,10 @@ if [ -n "${SSTATE_DIR}" ]; then
fi fi
if [ -n "${KAS_REPO_REF_DIR}" ]; then if [ -n "${KAS_REPO_REF_DIR}" ]; then
if [ ! -d "${KAS_REPO_REF_DIR}" ]; then
echo "Passed KAS_REPO_REF_DIR '${KAS_REPO_REF_DIR}' is not a directory"
exit 1
fi
set -- "$@" \ set -- "$@" \
-v "$(readlink -f "${KAS_REPO_REF_DIR}")":/repo-ref:ro \ -v "$(readlink -f "${KAS_REPO_REF_DIR}")":/repo-ref:ro \
-e KAS_REPO_REF_DIR=/repo-ref -e KAS_REPO_REF_DIR=/repo-ref