Skip to content

Commit

Permalink
task/buildah-remote*: fix for multi-platform
Browse files Browse the repository at this point in the history
The new 'icm' step was broken because it didn't take into account the
IMAGE modifications done in every other step. To fix it, switch the step
from "command-style" to "script-style" to make the task-generator tool
notice that it has to do its thing.

Signed-off-by: Adam Cmiel <[email protected]>
  • Loading branch information
chmeliik authored and ralphbean committed Jan 3, 2025
1 parent dcc5eec commit b858cb2
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 9 deletions.
6 changes: 4 additions & 2 deletions task/buildah-oci-ta/0.2/buildah-oci-ta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -556,12 +556,14 @@ spec:
- SETFCAP
- name: icm
image: quay.io/konflux-ci/icm-injection-scripts:latest@sha256:462980e94ba689b5f56c3d5dfb3358cd8c685300daf65a71532f11898935e7f1
args:
- $(params.IMAGE)
workingDir: /var/workdir
volumeMounts:
- mountPath: /var/lib/containers
name: varlibcontainers
script: |
#!/bin/bash
set -euo pipefail
/scripts/inject-icm.sh "$IMAGE"
securityContext:
capabilities:
add:
Expand Down
12 changes: 9 additions & 3 deletions task/buildah-remote-oci-ta/0.2/buildah-remote-oci-ta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -649,11 +649,17 @@ spec:
name: ssh
readOnly: true
workingDir: /var/workdir
- args:
- $(params.IMAGE)
computeResources: {}
- computeResources: {}
image: quay.io/konflux-ci/icm-injection-scripts:latest@sha256:462980e94ba689b5f56c3d5dfb3358cd8c685300daf65a71532f11898935e7f1
name: icm
script: |
#!/bin/bash
set -euo pipefail
if [ "${IMAGE_APPEND_PLATFORM}" == "true" ]; then
IMAGE="${IMAGE}-${PLATFORM//[^a-zA-Z0-9]/-}"
export IMAGE
fi
/scripts/inject-icm.sh "$IMAGE"
securityContext:
capabilities:
add:
Expand Down
12 changes: 9 additions & 3 deletions task/buildah-remote/0.2/buildah-remote.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -625,11 +625,17 @@ spec:
name: ssh
readOnly: true
workingDir: $(workspaces.source.path)
- args:
- $(params.IMAGE)
computeResources: {}
- computeResources: {}
image: quay.io/konflux-ci/icm-injection-scripts:latest@sha256:462980e94ba689b5f56c3d5dfb3358cd8c685300daf65a71532f11898935e7f1
name: icm
script: |
#!/bin/bash
set -euo pipefail
if [ "${IMAGE_APPEND_PLATFORM}" == "true" ]; then
IMAGE="${IMAGE}-${PLATFORM//[^a-zA-Z0-9]/-}"
export IMAGE
fi
/scripts/inject-icm.sh "$IMAGE"
securityContext:
capabilities:
add:
Expand Down
5 changes: 4 additions & 1 deletion task/buildah/0.2/buildah.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,10 @@ spec:
- mountPath: /var/lib/containers
name: varlibcontainers
workingDir: $(workspaces.source.path)
args: [$(params.IMAGE)]
script: |
#!/bin/bash
set -euo pipefail
/scripts/inject-icm.sh "$IMAGE"
- name: push
image: quay.io/konflux-ci/buildah-task:latest@sha256:b2d6c32d1e05e91920cd4475b2761d58bb7ee11ad5dff3ecb59831c7572b4d0c
script: |
Expand Down

0 comments on commit b858cb2

Please sign in to comment.