Skip to content

Commit

Permalink
fix: quote string var to prevent word splitting
Browse files Browse the repository at this point in the history
* quote string var to prevent word splitting SC2046
  refer to https://github.com/konflux-ci/build-definitions/
  actions/runs/11034165969/job/30647384452?pr=1468

Signed-off-by: Hongwei Liu <[email protected]>
  • Loading branch information
hongweiliu17 committed Sep 25, 2024
1 parent b8c9f2b commit 83f6e8a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions task/fbc-validation/0.1/fbc-validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ spec:
echo "Base image is unknown. The file-based catalog must have base image defined. Check inspect-image task log."
note="Task $(context.task.name) failed: The file-based catalog must have base image defined. For details, check Tekton task result TEST_OUTPUT in task inspect-image."
TEST_OUTPUT=$(make_result_json -r ERROR -t "$note")
echo "${TEST_OUTPUT}" | tee $(results.TEST_OUTPUT.path)
echo "${TEST_OUTPUT}" | tee "$(results.TEST_OUTPUT.path)"
exit 0
fi
Expand All @@ -82,7 +82,7 @@ spec:
echo "Base image ${BASE_IMAGE} is not allowed for the file based catalog image. Allowed images: ${ALLOWED_BASE_IMAGES}"
note="Task $(context.task.name) failed: Base image ${BASE_IMAGE} is not allowed for the file based catalog image. For details, check Tekton task logs"
TEST_OUTPUT=$(make_result_json -r FAILURE -f 1 -t "$note")
echo "${TEST_OUTPUT}" | tee $(results.TEST_OUTPUT.path)
echo "${TEST_OUTPUT}" | tee "$(results.TEST_OUTPUT.path)"
exit 0
fi
Expand All @@ -91,15 +91,15 @@ spec:
echo "File $(workspaces.workspace.path)/hacbs/inspect-image/image_inspect.json did not generate correctly. Check inspect-image task log."
note="Task $(context.task.name) failed: $(workspaces.workspace.path)/hacbs/inspect-image/image_inspect.json did not generate correctly. For details, check Tekton task result TEST_OUTPUT in task inspect-image."
TEST_OUTPUT=$(make_result_json -r ERROR -t "$note")
echo "${TEST_OUTPUT}" | tee $(results.TEST_OUTPUT.path)
echo "${TEST_OUTPUT}" | tee "$(results.TEST_OUTPUT.path)"
exit 0
fi
if [ ! -s ../inspect-image/raw_image_inspect.json ]; then
echo "File $(workspaces.workspace.path)/hacbs/inspect-image/raw_image_inspect.json did not generate correctly. Check inspect-image task log."
note="Task $(context.task.name) failed: $(workspaces.workspace.path)/hacbs/inspect-image/raw_image_inspect.json did not generate correctly. For details, check Tekton task result TEST_OUTPUT in task inspect-image."
TEST_OUTPUT=$(make_result_json -r ERROR -t "$note")
echo "${TEST_OUTPUT}" | tee $(results.TEST_OUTPUT.path)
echo "${TEST_OUTPUT}" | tee "$(results.TEST_OUTPUT.path)"
exit 0
fi
Expand Down Expand Up @@ -128,7 +128,7 @@ spec:
echo "Unable to extract or validate extracted binaries."
note="Task $(context.task.name) failed: Failed to extract image with oc extract command, so it cannot validate extracted binaries. For details, check Tekton task log."
ERROR_OUTPUT=$(make_result_json -r ERROR -t "$note")
echo "${TEST_OUTPUT}" | tee $(results.TEST_OUTPUT.path)
echo "${TEST_OUTPUT}" | tee "$(results.TEST_OUTPUT.path)"
popd
exit 0
fi
Expand Down Expand Up @@ -260,9 +260,9 @@ spec:
note="Task $(context.task.name) completed: Check result for task result."
if [ $TESTPASSED == false ]; then
ERROR_OUTPUT=$(make_result_json -r FAILURE -f $failure_num -s $((check_num - failure_num)) -t "$note")
echo "${ERROR_OUTPUT}" | tee $(results.TEST_OUTPUT.path)
echo "${ERROR_OUTPUT}" | tee "$(results.TEST_OUTPUT.path)"
else
TEST_OUTPUT=$(make_result_json -r SUCCESS -s $check_num -t "$note")
echo "${TEST_OUTPUT}" | tee $(results.TEST_OUTPUT.path)
echo "${TEST_OUTPUT}" | tee "$(results.TEST_OUTPUT.path)"
fi
popd

0 comments on commit 83f6e8a

Please sign in to comment.