Skip to content

Commit

Permalink
update to the latest release of the coverity image
Browse files Browse the repository at this point in the history
  • Loading branch information
kdudka committed Dec 12, 2024
1 parent 9e8ff7e commit 900aa21
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ spec:
- $(params.SOURCE_ARTIFACT)=/var/workdir/source
- $(params.CACHI2_ARTIFACT)=/var/workdir/cachi2
- name: prepare
image: quay.io/redhat-user-workloads/sast-tenant/sast-scanner/coverity@sha256:4c17d06f245d124bed3f8f50085144d5237fd09e9c72897fde84a694780c65de
image: quay.io/redhat-services-prod/sast/coverity:202409.1
workingDir: /var/workdir
volumeMounts:
- mountPath: /etc/secrets/cov
Expand Down Expand Up @@ -312,7 +312,7 @@ spec:
# instrument all RUN lines in Dockerfile to be executed through cmd-wrap.sh
cstrans-df-run --verbose /shared/cmd-wrap.sh <"$dockerfile_path" >/shared/Containerfile
- name: build
image: quay.io/redhat-user-workloads/sast-tenant/sast-scanner/coverity@sha256:4c17d06f245d124bed3f8f50085144d5237fd09e9c72897fde84a694780c65de
image: quay.io/redhat-services-prod/sast/coverity:202409.1
args:
- --build-args
- $(params.BUILD_ARGS[*])
Expand Down Expand Up @@ -439,9 +439,9 @@ spec:
BUILD_ARG_FLAGS+=("--build-arg=$build_arg")
done
dockerfile-json "${BUILD_ARG_FLAGS[@]}" "$dockerfile_copy" >/shared/parsed_dockerfile.json
BASE_IMAGES=$(
dockerfile-json "${BUILD_ARG_FLAGS[@]}" "$dockerfile_copy" |
jq -r '.Stages[] | select(.From | .Stage or .Scratch | not) | .BaseName | select(test("^oci-archive:") | not)'
jq -r '.Stages[] | select(.From | .Stage or .Scratch | not) | .BaseName | select(test("^oci-archive:") | not)' /shared/parsed_dockerfile.json
)
BUILDAH_ARGS=()
Expand Down Expand Up @@ -621,11 +621,13 @@ spec:
touch /shared/base_images_digests
for image in $BASE_IMAGES; do
buildah images --format '{{ .Name }}:{{ .Tag }}@{{ .Digest }}' --filter reference="$image" >>/shared/base_images_digests
base_image_digest=$(buildah images --format '{{ .Name }}:{{ .Tag }}@{{ .Digest }}' --filter reference="$image")
# In some cases, there might be BASE_IMAGES, but not any associated digest. This happens
# if buildah did not use that particular image during build because it was skipped
if [ -n "$base_image_digest" ]; then
echo "$image $base_image_digest" >>/shared/base_images_digests
fi
done
# Needed to generate base images SBOM
echo "$BASE_IMAGES" >/shared/base_images_from_dockerfile
computeResources:
limits:
cpu: "16"
Expand All @@ -638,7 +640,7 @@ spec:
add:
- SETFCAP
- name: postprocess
image: quay.io/redhat-user-workloads/sast-tenant/sast-scanner/coverity@sha256:4c17d06f245d124bed3f8f50085144d5237fd09e9c72897fde84a694780c65de
image: quay.io/redhat-services-prod/sast/coverity:202409.1
workingDir: /var/workdir
volumeMounts:
- mountPath: /mnt/trusted-ca
Expand Down
6 changes: 3 additions & 3 deletions task/sast-coverity-check/0.2/patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
- op: replace
path: /spec/steps/0/image
# New image shoould be based on quay.io/konflux-ci/buildah-task:latest or have all the tooling that the original image has.
value: quay.io/redhat-user-workloads/sast-tenant/sast-scanner/coverity@sha256:4c17d06f245d124bed3f8f50085144d5237fd09e9c72897fde84a694780c65de
value: quay.io/redhat-services-prod/sast/coverity:202409.1

# Change build step resources
- op: replace
Expand Down Expand Up @@ -125,7 +125,7 @@
path: /spec/steps/0
value:
name: prepare
image: quay.io/redhat-user-workloads/sast-tenant/sast-scanner/coverity@sha256:4c17d06f245d124bed3f8f50085144d5237fd09e9c72897fde84a694780c65de
image: quay.io/redhat-services-prod/sast/coverity:202409.1
workingDir: $(workspaces.source.path)
env:
- name: DOCKERFILE
Expand Down Expand Up @@ -206,7 +206,7 @@
path: /spec/steps/2
value:
name: postprocess
image: quay.io/redhat-user-workloads/sast-tenant/sast-scanner/coverity@sha256:4c17d06f245d124bed3f8f50085144d5237fd09e9c72897fde84a694780c65de
image: quay.io/redhat-services-prod/sast/coverity:202409.1
computeResources:
limits:
memory: 4Gi
Expand Down
21 changes: 12 additions & 9 deletions task/sast-coverity-check/0.2/sast-coverity-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ spec:
- env:
- name: DOCKERFILE
value: $(params.DOCKERFILE)
image: quay.io/redhat-user-workloads/sast-tenant/sast-scanner/coverity@sha256:4c17d06f245d124bed3f8f50085144d5237fd09e9c72897fde84a694780c65de
image: quay.io/redhat-services-prod/sast/coverity:202409.1
name: prepare
script: |
#!/bin/bash -x
Expand Down Expand Up @@ -283,7 +283,7 @@ spec:
/shared:/shared
/shared/license.dat:/opt/coverity/bin/license.dat
/usr/libexec/csgrep-static:/usr/libexec/csgrep-static
image: quay.io/redhat-user-workloads/sast-tenant/sast-scanner/coverity@sha256:4c17d06f245d124bed3f8f50085144d5237fd09e9c72897fde84a694780c65de
image: quay.io/redhat-services-prod/sast/coverity:202409.1
name: build
script: |
#!/bin/bash
Expand Down Expand Up @@ -376,9 +376,10 @@ spec:
BUILD_ARG_FLAGS+=("--build-arg=$build_arg")
done
dockerfile-json "${BUILD_ARG_FLAGS[@]}" "$dockerfile_copy" > /shared/parsed_dockerfile.json
BASE_IMAGES=$(
dockerfile-json "${BUILD_ARG_FLAGS[@]}" "$dockerfile_copy" |
jq -r '.Stages[] | select(.From | .Stage or .Scratch | not) | .BaseName | select(test("^oci-archive:") | not)'
jq -r '.Stages[] | select(.From | .Stage or .Scratch | not) | .BaseName | select(test("^oci-archive:") | not)' /shared/parsed_dockerfile.json
)
BUILDAH_ARGS=()
Expand Down Expand Up @@ -560,11 +561,13 @@ spec:
touch /shared/base_images_digests
for image in $BASE_IMAGES; do
buildah images --format '{{ .Name }}:{{ .Tag }}@{{ .Digest }}' --filter reference="$image" >> /shared/base_images_digests
base_image_digest=$(buildah images --format '{{ .Name }}:{{ .Tag }}@{{ .Digest }}' --filter reference="$image")
# In some cases, there might be BASE_IMAGES, but not any associated digest. This happens
# if buildah did not use that particular image during build because it was skipped
if [ -n "$base_image_digest" ]; then
echo "$image $base_image_digest" >> /shared/base_images_digests
fi
done
# Needed to generate base images SBOM
echo "$BASE_IMAGES" > /shared/base_images_from_dockerfile
securityContext:
capabilities:
add:
Expand Down Expand Up @@ -606,7 +609,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.labels['appstudio.openshift.io/component']
image: quay.io/redhat-user-workloads/sast-tenant/sast-scanner/coverity@sha256:4c17d06f245d124bed3f8f50085144d5237fd09e9c72897fde84a694780c65de
image: quay.io/redhat-services-prod/sast/coverity:202409.1
name: postprocess
script: |
#!/bin/bash -ex
Expand Down

0 comments on commit 900aa21

Please sign in to comment.