Skip to content

Commit

Permalink
fix(kaniko): workaround for passing arguments containing spaces
Browse files Browse the repository at this point in the history
set up input field separator as null and use eval to run kaniko executor
  • Loading branch information
idrissneumann authored and aexvir committed Jan 11, 2024
1 parent 10b098c commit a95ae7d
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ if [ ! -z $INPUT_SKIP_UNCHANGED_DIGEST ]; then
else
export DESTINATION="--destination $IMAGE"
if [ ! -z $IMAGE_LATEST ]; then
export DESTINATION="$DESTINATION --destination $IMAGE_LATEST"
export DESTINATION="$DESTINATION --destination $IMAGE_LATEST"
fi
fi

Expand All @@ -88,8 +88,13 @@ cat <<EOF >/kaniko/.docker/config.json
}
EOF

# https://github.com/GoogleContainerTools/kaniko/issues/1803
# https://github.com/GoogleContainerTools/kaniko/issues/1349
/kaniko/executor --reproducible --force $ARGS
export IFS=''
kaniko_cmd="/kaniko/executor ${ARGS} --reproducible --force"
echo "Running kaniko command ${kaniko_cmd}"
eval "${kaniko_cmd}"

echo "image=$IMAGE" >> $GITHUB_OUTPUT

if [ ! -z $INPUT_SKIP_UNCHANGED_DIGEST ]; then
Expand All @@ -106,13 +111,13 @@ if [ ! -z $INPUT_SKIP_UNCHANGED_DIGEST ]; then
fi

echo "Pushing image..."

/kaniko/crane push image.tar $IMAGE

if [ ! -z $IMAGE_LATEST ]; then
echo "Tagging latest..."
/kaniko/crane tag $IMAGE latest
/kaniko/crane tag $IMAGE latest
fi

echo "Done 🎉️"
fi

0 comments on commit a95ae7d

Please sign in to comment.