File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -336,8 +336,11 @@ spec:
336336 CONVERTED_REFS+=("${NEW_IMAGE_REF}")
337337 done
338338
339- # Write array result as JSON
340- printf '%s\n' "${CONVERTED_REFS[@]}" | jq -R . | jq -s . > "$(results.IMAGE_REFS.path)"
339+ # Write array result as JSON array (Tekton format for typed array results)
340+ # Each element must be properly JSON-escaped
341+ echo "[$(date --utc -Ins)] Writing ${#CONVERTED_REFS[@]} image refs to results"
342+ jq -cn '$ARGS.positional' --args "${CONVERTED_REFS[@]}" > "$(results.IMAGE_REFS.path)"
343+ cat "$(results.IMAGE_REFS.path)"
341344 echo "[$(date --utc -Ins)] All conversions complete"
342345 securityContext :
343346 capabilities :
Original file line number Diff line number Diff line change @@ -399,8 +399,11 @@ spec:
399399 CONVERTED_REFS+=("${NEW_IMAGE_REF}")
400400 done
401401
402- # Write array result as JSON
403- printf '%s\n' "${CONVERTED_REFS[@]}" | jq -R . | jq -s . > "$(results.IMAGE_REFS.path)"
402+ # Write array result as JSON array (Tekton format for typed array results)
403+ # Each element must be properly JSON-escaped
404+ echo "[$(date --utc -Ins)] Writing ${#CONVERTED_REFS[@]} image refs to results"
405+ jq -cn '$ARGS.positional' --args "${CONVERTED_REFS[@]}" > "$(results.IMAGE_REFS.path)"
406+ cat "$(results.IMAGE_REFS.path)"
404407 echo "[$(date --utc -Ins)] All conversions complete"
405408 securityContext :
406409 capabilities :
Original file line number Diff line number Diff line change @@ -419,8 +419,11 @@ spec:
419419 CONVERTED_REFS+=("${NEW_IMAGE_REF}")
420420 done
421421
422- # Write array result as JSON
423- printf '%s\n' "${CONVERTED_REFS[@]}" | jq -R . | jq -s . > "$(results.IMAGE_REFS.path)"
422+ # Write array result as JSON array (Tekton format for typed array results)
423+ # Each element must be properly JSON-escaped
424+ echo "[$(date --utc -Ins)] Writing ${#CONVERTED_REFS[@]} image refs to results"
425+ jq -cn '$ARGS.positional' --args "${CONVERTED_REFS[@]}" > "$(results.IMAGE_REFS.path)"
426+ cat "$(results.IMAGE_REFS.path)"
424427 echo "[$(date --utc -Ins)] All conversions complete"
425428 securityContext :
426429 capabilities :
You can’t perform that action at this time.
0 commit comments