Skip to content

Commit

Permalink
fix(RELEASE-1090): linting issues in sign-index-image (#747)
Browse files Browse the repository at this point in the history
Signed-off-by: Johnny Bieren <[email protected]>
  • Loading branch information
johnbieren authored Dec 17, 2024
1 parent 9e15f03 commit 34d2300
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ spec:
- name: setup-values
image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
script: |
#!/usr/bin/env sh
#!/usr/bin/env bash
set -eux
cat > $(workspaces.data.path)/data.json << EOF
cat > "$(workspaces.data.path)/data.json" << EOF
{
"sign": {
"configMapName": "signing-config-map"
Expand Down Expand Up @@ -92,32 +92,33 @@ spec:
#!/usr/bin/env bash
set -eux
internalRequest="$(kubectl get internalrequest --sort-by=.metadata.creationTimestamp --no-headers)"
params=$(kubectl get internalrequest ${internalRequest} -o jsonpath="{.spec.params}")
internalRequest="$(kubectl get internalrequest --sort-by=.metadata.creationTimestamp --no-headers \
-o custom-columns=":metadata.name")"
params=$(kubectl get internalrequest "${internalRequest}" -o jsonpath="{.spec.params}")
if [ $(jq -r '.reference' <<< "${params}") != "registry.redhat.io/redhat/testimage:tag" ]; then
if [ "$(jq -r '.reference' <<< "${params}")" != "registry.redhat.io/redhat/testimage:tag" ]; then
echo "reference image does not match"
exit 1
fi
if [ $(jq -r '.manifest_digest' <<< "${params}") != "sha256:6f9a420f660e73b" ]; then
if [ "$(jq -r '.manifest_digest' <<< "${params}")" != "sha256:6f9a420f660e73b" ]; then
echo "manifest_digest does not match"
exit 1
fi
if [ $(jq -r '.config_map_name' <<< "${params}") != "signing-config-map" ]
if [ "$(jq -r '.config_map_name' <<< "${params}")" != "signing-config-map" ]
then
echo "config_map_name does not match"
exit 1
fi
if [ $(jq -r '.requester' <<< "${params}") != "testuser" ]
if [ "$(jq -r '.requester' <<< "${params}")" != "testuser" ]
then
echo "requester does not match"
exit 1
fi
if [ $(jq -r '.pipeline_image' <<< "${params}") != \
if [ "$(jq -r '.pipeline_image' <<< "${params}")" != \
"quay.io/redhat-isv/operator-pipelines-images:released" ]
then
echo "pipeline_image does not match"
Expand All @@ -132,7 +133,7 @@ spec:
- name: delete-crs
image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
script: |
#!/usr/bin/env sh
#!/usr/bin/env bash
set -eux
kubectl delete internalrequests --all
22 changes: 11 additions & 11 deletions tasks/sign-index-image/tests/test-sign-index-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ spec:
- name: setup-values
image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
script: |
#!/usr/bin/env sh
#!/usr/bin/env bash
set -eux
cat > $(workspaces.data.path)/data.json << EOF
cat > "$(workspaces.data.path)/data.json" << EOF
{
"sign": {
"configMapName": "signing-config-map"
Expand Down Expand Up @@ -96,40 +96,40 @@ spec:
testValues=('sha256:6f9a420f660e73a' \
'sha256:6f9a420f660e73b')
internalRequests="$(kubectl get internalrequest --sort-by=.metadata.creationTimestamp --no-headers)"
internalRequestsCount=$(echo $internalRequests | wc -w)
internalRequestsCount=$(echo "$internalRequests" | wc -w)
if [ $internalRequestsCount != "2" ] ; then
if [ "$internalRequestsCount" != "2" ] ; then
echo "incorrect number of internalRequests created. Expected 2"
exit 1
fi
for internalRequest in ${internalRequests};
do
params=$(kubectl get internalrequest ${internalRequest} -o jsonpath="{.spec.params}")
params=$(kubectl get internalrequest "${internalRequest}" -o jsonpath="{.spec.params}")
if [ $(jq -r '.reference' <<< "${params}") != "quay.io/testrepo/testimage:tag" ]; then
if [ "$(jq -r '.reference' <<< "${params}")" != "quay.io/testrepo/testimage:tag" ]; then
echo "reference image does not match"
exit 1
fi
if [ $(jq -r '.manifest_digest' <<< "${params}") != "${testValues[$counter]}" ]; then
if [ "$(jq -r '.manifest_digest' <<< "${params}")" != "${testValues[$counter]}" ]; then
echo "manifest_digest does not match"
exit 1
fi
if [ $(jq -r '.config_map_name' <<< "${params}") != "signing-config-map" ]
if [ "$(jq -r '.config_map_name' <<< "${params}")" != "signing-config-map" ]
then
echo "config_map_name does not match"
exit 1
fi
if [ $(jq -r '.requester' <<< "${params}") != "testuser" ]
if [ "$(jq -r '.requester' <<< "${params}")" != "testuser" ]
then
echo "requester does not match"
exit 1
fi
if [ $(jq -r '.pipeline_image' <<< "${params}") != \
if [ "$(jq -r '.pipeline_image' <<< "${params}")" != \
"quay.io/redhat-isv/operator-pipelines-images:released" ]
then
echo "pipeline_image does not match"
Expand All @@ -147,7 +147,7 @@ spec:
- name: delete-crs
image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
script: |
#!/usr/bin/env sh
#!/usr/bin/env bash
set -eux
kubectl delete internalrequests --all

0 comments on commit 34d2300

Please sign in to comment.