Skip to content

Commit 5062466

Browse files
committed
sast-coverity-check: rename the workspace to source
... to make the interface compatible with the `build-container` task Related: konflux-ci#1653
1 parent 48fce4d commit 5062466

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

pipelines/template-build/template-build.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ spec:
255255
- name: image-url
256256
value: $(tasks.build-image-index.results.IMAGE_URL)
257257
workspaces:
258-
- name: workspace
258+
- name: source
259259
workspace: workspace
260260
- name: coverity-availability-check
261261
when:

task/sast-coverity-check/0.2/sast-coverity-check.yaml

+7-7
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ spec:
8686
cpu: "16"
8787
# per https://kubernetes.io/docs/concepts/containers/images/#imagepullpolicy-defaulting
8888
# the cluster will set imagePullPolicy to IfNotPresent
89-
workingDir: $(workspaces.workspace.path)/hacbs/$(context.task.name)
89+
workingDir: $(workspaces.source.path)/hacbs/$(context.task.name)
9090
volumeMounts:
9191
- name: cov-license
9292
mountPath: "/etc/secrets/cov"
@@ -130,9 +130,9 @@ spec:
130130
echo "The PROJECT_NAME used is: ${PROJECT_NAME}"
131131
132132
COVERITY_DIR=/var/tmp/coverity/idir
133-
COVERITY_RESULTS_FILE=$(workspaces.workspace.path)/coverity-buildless-results.json
133+
COVERITY_RESULTS_FILE=$(workspaces.source.path)/coverity-buildless-results.json
134134
COV_LICENSE_PATH=/etc/secrets/cov/cov-license
135-
SOURCE_CODE_DIR=$(workspaces.workspace.path)
135+
SOURCE_CODE_DIR=$(workspaces.source.path)
136136
137137
# Installing Coverity license
138138
cp "$COV_LICENSE_PATH" /opt/coverity/bin/license.dat
@@ -227,23 +227,23 @@ spec:
227227
(set -x $$ csgrep --mode=evtstat filtered_sast_coverity_buildless_check_all_findings.json)
228228
fi
229229
230-
csgrep --mode=sarif filtered_sast_coverity_buildless_check_all_findings.json > "$(workspaces.workspace.path)"/coverity-results.sarif
230+
csgrep --mode=sarif filtered_sast_coverity_buildless_check_all_findings.json > "$(workspaces.source.path)"/coverity-results.sarif
231231
232232
if [[ -z "$(csgrep --mode=evtstat filtered_sast_coverity_buildless_check_all_findings.json)" ]]; then
233233
note="Task $(context.task.name) success: No finding was detected"
234234
ERROR_OUTPUT=$(make_result_json -r SUCCESS -t "$note")
235235
echo "${ERROR_OUTPUT}" | tee "$(results.TEST_OUTPUT.path)"
236236
else
237237
TEST_OUTPUT=
238-
parse_test_output "$(context.task.name)" sarif "$(workspaces.workspace.path)"/coverity-results.sarif || true
238+
parse_test_output "$(context.task.name)" sarif "$(workspaces.source.path)"/coverity-results.sarif || true
239239
note="Task $(context.task.name) failed: For details, check Tekton task log."
240240
echo "${ERROR_OUTPUT}" | tee "$(results.TEST_OUTPUT.path)"
241241
fi
242242
243243
echo "${TEST_OUTPUT:-${ERROR_OUTPUT}}" | tee "$(results.TEST_OUTPUT.path)"
244244
- name: upload
245245
image: quay.io/konflux-ci/oras:latest@sha256:99737f436051e6d3866eb8a8706463c35abf72c87f05090ff42ff642f6729661
246-
workingDir: $(workspaces.workspace.path)
246+
workingDir: $(workspaces.source.path)
247247
env:
248248
- name: IMAGE_URL
249249
value: $(params.image-url)
@@ -273,4 +273,4 @@ spec:
273273
oras attach --no-tty --registry-config "$HOME/auth.json" --artifact-type "${MEDIA_TYPE}" "${IMAGE_URL}" "${UPLOAD_FILE}:${MEDIA_TYPE}"
274274
done
275275
workspaces:
276-
- name: workspace
276+
- name: source

0 commit comments

Comments
 (0)