Skip to content

Commit 0e4715d

Browse files
committed
Add support for self-signed OCI registries to clamav-scan task
The upload step required a fix to test this. It was silently failing to find any logs because the `find` command isn't present in the oras image. Signed-off-by: Alex Misstear <[email protected]>
1 parent 7be9051 commit 0e4715d

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

task/clamav-scan/0.2/clamav-scan.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,14 +177,18 @@ spec:
177177
workingDir: /work
178178
script: |
179179
#!/usr/bin/env bash
180+
set -e
181+
182+
# Don't return a glob expression when no matches are found
183+
shopt -s nullglob
180184
181185
cd logs
182186
183-
for UPLOAD_FILE in $(find . -name "clamscan-result*.log"); do
187+
for UPLOAD_FILE in clamscan-result*.log; do
184188
MEDIA_TYPE=text/vnd.clamav
185189
args+=("${UPLOAD_FILE}:${MEDIA_TYPE}")
186190
done
187-
for UPLOAD_FILE in $(find . -name "clamscan-ec-test*.json"); do
191+
for UPLOAD_FILE in clamscan-ec-test*.json; do
188192
MEDIA_TYPE=application/vnd.konflux.test_output+json
189193
args+=("${UPLOAD_FILE}:${MEDIA_TYPE}")
190194
done
@@ -201,6 +205,10 @@ spec:
201205
volumeMounts:
202206
- mountPath: /work
203207
name: work
208+
- name: trusted-ca
209+
mountPath: /etc/pki/tls/certs/ca-custom-bundle.crt
210+
subPath: ca-bundle.crt
211+
readOnly: true
204212
volumes:
205213
- name: dbfolder
206214
emptyDir: {}

0 commit comments

Comments
 (0)