Skip to content

Commit

Permalink
Adapt koparse step to handle no import path
Browse files Browse the repository at this point in the history
The case of no import path included in image paths breaks
koparse. Adapting the step to handle this case too.

Signed-off-by: Andrea Frittoli <[email protected]>
  • Loading branch information
afrittoli authored and tekton-robot committed Sep 12, 2024
1 parent d84a0a1 commit cd8a41e
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion tekton/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,22 @@ spec:
script: |
set -ex
IMAGES_PATH=${CONTAINER_REGISTRY}/$(params.package)
IMAGES_PATH=${CONTAINER_REGISTRY}
# Find "--preserve-import-paths" in a list of args
function find_preserve_import_path() {
for arg in $@; do
if [[ "$arg" == "--preserve-import-paths" ]]; then
return 0
fi
done
return 1
}
# If "--preserve-import-paths" is used, include "package" in the expected path
find_preserve_import_path \
$(echo $KO_EXTRA_ARGS) && \
IMAGES_PATH=${IMAGES_PATH}/$(params.package) || true
for cmd in $(params.images)
do
Expand Down

0 comments on commit cd8a41e

Please sign in to comment.