From 266f2fcd217261a02bd036719c61afdc73d3959a Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Mon, 25 Nov 2024 16:06:55 +0100 Subject: [PATCH] sast-coverity-check: rename the workspace to `source` ... to make the interface compatible with the `build-container` task Related: https://github.com/konflux-ci/build-definitions/pull/1653 --- pipelines/template-build/template-build.yaml | 2 +- .../0.2/sast-coverity-check.yaml | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pipelines/template-build/template-build.yaml b/pipelines/template-build/template-build.yaml index 924fe52967..2e19cd46d8 100644 --- a/pipelines/template-build/template-build.yaml +++ b/pipelines/template-build/template-build.yaml @@ -255,7 +255,7 @@ spec: - name: image-url value: $(tasks.build-image-index.results.IMAGE_URL) workspaces: - - name: workspace + - name: source workspace: workspace - name: coverity-availability-check when: diff --git a/task/sast-coverity-check/0.2/sast-coverity-check.yaml b/task/sast-coverity-check/0.2/sast-coverity-check.yaml index d567ac4613..5080295ed9 100644 --- a/task/sast-coverity-check/0.2/sast-coverity-check.yaml +++ b/task/sast-coverity-check/0.2/sast-coverity-check.yaml @@ -86,7 +86,7 @@ spec: cpu: "16" # per https://kubernetes.io/docs/concepts/containers/images/#imagepullpolicy-defaulting # the cluster will set imagePullPolicy to IfNotPresent - workingDir: $(workspaces.workspace.path)/hacbs/$(context.task.name) + workingDir: $(workspaces.source.path)/hacbs/$(context.task.name) volumeMounts: - name: cov-license mountPath: "/etc/secrets/cov" @@ -130,9 +130,9 @@ spec: echo "The PROJECT_NAME used is: ${PROJECT_NAME}" COVERITY_DIR=/var/tmp/coverity/idir - COVERITY_RESULTS_FILE=$(workspaces.workspace.path)/coverity-buildless-results.json + COVERITY_RESULTS_FILE=$(workspaces.source.path)/coverity-buildless-results.json COV_LICENSE_PATH=/etc/secrets/cov/cov-license - SOURCE_CODE_DIR=$(workspaces.workspace.path) + SOURCE_CODE_DIR=$(workspaces.source.path) # Installing Coverity license cp "$COV_LICENSE_PATH" /opt/coverity/bin/license.dat @@ -227,7 +227,7 @@ spec: (set -x $$ csgrep --mode=evtstat filtered_sast_coverity_buildless_check_all_findings.json) fi - csgrep --mode=sarif filtered_sast_coverity_buildless_check_all_findings.json > "$(workspaces.workspace.path)"/coverity-results.sarif + csgrep --mode=sarif filtered_sast_coverity_buildless_check_all_findings.json > "$(workspaces.source.path)"/coverity-results.sarif if [[ -z "$(csgrep --mode=evtstat filtered_sast_coverity_buildless_check_all_findings.json)" ]]; then note="Task $(context.task.name) success: No finding was detected" @@ -235,7 +235,7 @@ spec: echo "${ERROR_OUTPUT}" | tee "$(results.TEST_OUTPUT.path)" else TEST_OUTPUT= - parse_test_output "$(context.task.name)" sarif "$(workspaces.workspace.path)"/coverity-results.sarif || true + parse_test_output "$(context.task.name)" sarif "$(workspaces.source.path)"/coverity-results.sarif || true note="Task $(context.task.name) failed: For details, check Tekton task log." echo "${ERROR_OUTPUT}" | tee "$(results.TEST_OUTPUT.path)" fi @@ -243,7 +243,7 @@ spec: echo "${TEST_OUTPUT:-${ERROR_OUTPUT}}" | tee "$(results.TEST_OUTPUT.path)" - name: upload image: quay.io/konflux-ci/oras:latest@sha256:99737f436051e6d3866eb8a8706463c35abf72c87f05090ff42ff642f6729661 - workingDir: $(workspaces.workspace.path) + workingDir: $(workspaces.source.path) env: - name: IMAGE_URL value: $(params.image-url) @@ -273,4 +273,4 @@ spec: oras attach --no-tty --registry-config "$HOME/auth.json" --artifact-type "${MEDIA_TYPE}" "${IMAGE_URL}" "${UPLOAD_FILE}:${MEDIA_TYPE}" done workspaces: - - name: workspace + - name: source