Skip to content

Commit bdf7b95

Browse files
authored
Add skopeo OS, arch overrides (#3064)
1 parent 75eb897 commit bdf7b95

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

hack/lib/images.bash

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ registry_prefix_quay="quay.io/redhat-user-workloads/ocp-serverless-tenant/server
1515
registry_quay="${registry_prefix_quay}${quay_registry_app_version}"
1616
registry_redhat_io="registry.redhat.io/openshift-serverless-1"
1717

18+
# Add extra flags to skopeo cmd, in case of MacOS add OS/arch overrides
19+
export SKOPEO_EXTRA_FLAGS="${SKOPE_EXTRA_FLAGS:-}"
20+
if [[ "$(uname -s)" == "Darwin" ]]; then
21+
SKOPEO_EXTRA_FLAGS="${SKOPEO_EXTRA_FLAGS} --override-os linux --override-arch amd64"
22+
fi
23+
1824
function get_serverless_operator_rhel_version() {
1925
sorhel --so-version="${CURRENT_VERSION}"
2026
}
@@ -336,7 +342,8 @@ function latest_konflux_image_sha() {
336342
function image_with_sha {
337343
image=${1:?"Provide image"}
338344

339-
digest=$(skopeo inspect --no-tags=true "docker://${image}" | jq -r '.Digest')
345+
# shellcheck disable=SC2086
346+
digest=$(skopeo inspect --no-tags=true ${SKOPEO_EXTRA_FLAGS} "docker://${image}" | jq -r '.Digest')
340347
if [ "${digest}" = "" ]; then
341348
echo ""
342349
fi

0 commit comments

Comments
 (0)