Skip to content

Commit

Permalink
feat(RELEASE-1332): publish-index-image pipeline uses git resolver (#803
Browse files Browse the repository at this point in the history
)

This commit updates the managed task that calls the publish-index-image
internal pipeline to call the pipeline via git resolver instead of
cluster resolver. It also moves the internal publish-index-image
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 authored Feb 5, 2025
1 parent b9a01d9 commit 045600a
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 16 deletions.
1 change: 0 additions & 1 deletion internal/resources/publish-index-image-pipeline.yaml

This file was deleted.

3 changes: 3 additions & 0 deletions tasks/managed/publish-index-image/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ Publish a built FBC index image using skopeo

## Changes in 4.0.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

## Changes in 3.3.0
* updated the base image used in this task
Expand Down
4 changes: 2 additions & 2 deletions tasks/managed/publish-index-image/publish-index-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ spec:
steps:
- name: publish-index-image
image: >-
quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
quay.io/konflux-ci/release-service-utils:0f82be4be43294b6a96846d87ef7f7c0b9e34267
script: |
#!/usr/bin/env bash
set -e
Expand All @@ -77,7 +77,7 @@ spec:
echo "- from: $(params.sourceIndex)"
echo "- to: ${publishingImages[$i]}"
internal-request -r "${request}" \
internal-request --pipeline "${request}" \
-p sourceIndex="$(params.sourceIndex)" \
-p targetIndex="${publishingImages[$i]}" \
-p publishingCredentials="${credentials}" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: tekton.dev/v1
kind: Pipeline
metadata:
name: test-publish-index-image
name: test-publish-index-image-with-timestamp
spec:
description: Test creating a internal request to publish an image
workspaces:
Expand All @@ -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 @@ -61,18 +61,20 @@ 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
internalRequest="$(kubectl get internalrequest --sort-by=.metadata.creationTimestamp --no-headers | \
sed 's/[[:space:]]*$//')"
request=$(kubectl get internalrequest "${internalRequest}" -o jsonpath="{.spec.request}")
pipeline="$(kubectl get internalrequest "${internalRequest}" -o \
jsonpath="{.spec.pipeline.pipelineRef.params[2].value}")"
params=$(kubectl get internalrequest "${internalRequest}" -o jsonpath="{.spec.params}")
if [ "$request" != "publish-index-image-pipeline" ]; then
echo "request pipeline does not match"
if [ "$pipeline" != \
"pipelines/internal/publish-index-image-pipeline/publish-index-image-pipeline.yaml" ]; then
echo "pipeline does not match"
exit 1
fi
Expand Down Expand Up @@ -108,7 +110,7 @@ spec:
taskSpec:
steps:
- name: delete-crs
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 @@ -61,7 +61,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 All @@ -76,11 +76,12 @@ spec:
fi
for((i=0; i<irIndex; i++)); do
request=$(jq -r ".[$i] | .spec.request" <<< "${internalRequests}")
pipeline=$(jq -r ".[$i] | .spec.pipeline.pipelineRef.params[2].value" <<< "${internalRequests}")
params=$(jq -r ".[$i] | .spec.params" <<< "${internalRequests}")
if [ "$request" != "publish-index-image-pipeline" ]; then
echo "request pipeline does not match"
if [ "$pipeline" != \
"pipelines/internal/publish-index-image-pipeline/publish-index-image-pipeline.yaml" ]; then
echo "pipeline does not match"
exit 1
fi
Expand Down Expand Up @@ -124,7 +125,7 @@ spec:
taskSpec:
steps:
- name: delete-crs
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

0 comments on commit 045600a

Please sign in to comment.