Skip to content

Commit

Permalink
feat(RELEASE-1328): embargo-check pipeline is called via git resolver
Browse files Browse the repository at this point in the history
This commit updates the managed task that calls the embargo-check
internal pipeline to call the pipeline via git resolver instead of
cluster resolver. It also moves the internal embargo-check pipeline to
its proper directory, which is where the internal-request script expects
it.

Signed-off-by: Johnny Bieren <[email protected]>
  • Loading branch information
johnbieren committed Jan 24, 2025
1 parent e405d54 commit 964cdba
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 14 deletions.
1 change: 0 additions & 1 deletion internal/resources/check-embargoed-cves.yaml

This file was deleted.

6 changes: 6 additions & 0 deletions tasks/managed/embargo-check/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ by server using curl and checks the CVEs via an InternalRequest. If any issue or

## Changes in 0.5.0
* Added taskGiturl and taskGitRevision parameters to be passed to the internalRequest
* The pipeline is called via git resolver now instead of cluster resolver
* This was done by changing from `-r` to `--pipeline` in the `internal-request` call
* The base image was updated to include this new functionality
* Add --pipeline-timeout as an argument to the internalRequest that is the same value as the requestTimeout
* This surpresses the warning about the pipeline timeout exceeding the request timeout
* Updated logic to determine InternalRequest name more reliably

## Changes in 0.4.1
* fix linting issues in embargo-check task
Expand Down
9 changes: 5 additions & 4 deletions tasks/managed/embargo-check/embargo-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spec:
description: The workspace where the snapshot spec json file resides
steps:
- name: check-issues
image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
image: quay.io/konflux-ci/release-service-utils:0f82be4be43294b6a96846d87ef7f7c0b9e34267
script: |
#!/usr/bin/env bash
set -x
Expand Down Expand Up @@ -79,7 +79,7 @@ spec:
exit $RC
- name: check-cves
image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
image: quay.io/konflux-ci/release-service-utils:0f82be4be43294b6a96846d87ef7f7c0b9e34267
script: |
#!/usr/bin/env bash
Expand All @@ -101,17 +101,18 @@ spec:
echo "Checking the following CVEs: ${CVES}"
internal-request -r "check-embargoed-cves" \
internal-request --pipeline "check-embargoed-cves" \
-p cves="${CVES}" \
-p taskGitUrl="$(params.taskGitUrl)" \
-p taskGitRevision="$(params.taskGitRevision)" \
-l ${PIPELINERUN_LABEL}="$(params.pipelineRunUid)" \
-t "$(params.requestTimeout)" \
--pipeline-timeout "$(params.requestTimeout)" \
-s true \
> "$(workspaces.data.path)"/ir-result.txt || \
(grep "^\[" "$(workspaces.data.path)"/ir-result.txt | jq . && exit 1)
internalRequest=$(awk 'NR==1{ print $2 }' "$(workspaces.data.path)"/ir-result.txt | xargs)
internalRequest=$(grep created "$(workspaces.data.path)"/ir-result.txt | awk 'NR==1{ print $2 }' | xargs)
echo "done (${internalRequest})"
results=$(kubectl get internalrequest "$internalRequest" -o=jsonpath='{.status.results}')
Expand Down
4 changes: 2 additions & 2 deletions tasks/managed/embargo-check/tests/mocks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ function curl() {

function internal-request() {
if [[ "$*" == *"CVE-999"* ]]; then
echo "Name: embargo-ir"
echo "InternalRequest 'embargo-ir' created."
elif [[ "$*" == *"CVE-FAIL-555"* ]]; then
exit 1
else
echo "Name: success-ir"
echo "InternalRequest 'success-ir' created."
fi
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
- name: data
steps:
- name: setup-values
image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
image: quay.io/konflux-ci/release-service-utils:0f82be4be43294b6a96846d87ef7f7c0b9e34267
script: |
#!/usr/bin/env sh
set -eux
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
- name: data
steps:
- name: setup-values
image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
image: quay.io/konflux-ci/release-service-utils:0f82be4be43294b6a96846d87ef7f7c0b9e34267
script: |
#!/usr/bin/env sh
set -eux
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
- name: data
steps:
- name: setup-values
image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
image: quay.io/konflux-ci/release-service-utils:0f82be4be43294b6a96846d87ef7f7c0b9e34267
script: |
#!/usr/bin/env sh
set -eux
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
- name: data
steps:
- name: setup-values
image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
image: quay.io/konflux-ci/release-service-utils:0f82be4be43294b6a96846d87ef7f7c0b9e34267
script: |
#!/usr/bin/env sh
set -eux
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
- name: data
steps:
- name: setup-values
image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
image: quay.io/konflux-ci/release-service-utils:0f82be4be43294b6a96846d87ef7f7c0b9e34267
script: |
#!/usr/bin/env sh
set -eux
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
- name: data
steps:
- name: setup-values
image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
image: quay.io/konflux-ci/release-service-utils:0f82be4be43294b6a96846d87ef7f7c0b9e34267
script: |
#!/usr/bin/env sh
set -eux
Expand Down Expand Up @@ -64,7 +64,7 @@ spec:
taskSpec:
steps:
- name: check-result
image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
image: quay.io/konflux-ci/release-service-utils:0f82be4be43294b6a96846d87ef7f7c0b9e34267
script: |
#!/usr/bin/env bash
set -eux
Expand Down

0 comments on commit 964cdba

Please sign in to comment.