From cb8cd650694ee874bb784c5ad2b470913208494b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20St=C3=A4bler?= Date: Fri, 4 Oct 2024 08:19:29 +0200 Subject: [PATCH] Add replace for OPM_IMAGE arg --- hack/lib/catalogsource.bash | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hack/lib/catalogsource.bash b/hack/lib/catalogsource.bash index 76f5c4a82f..f1a7a92e0d 100644 --- a/hack/lib/catalogsource.bash +++ b/hack/lib/catalogsource.bash @@ -119,7 +119,7 @@ EOF # Dockerfiles might specify "FROM $XYZ" which fails OpenShift on-cluster # builds. Replace the references with real images. function replace_images() { - local dockerfile_path tmp_dockerfile go_runtime go_builder + local dockerfile_path tmp_dockerfile go_runtime go_builder opm_image dockerfile_path=${1:?Pass dockerfile path} tmp_dockerfile=$(mktemp /tmp/Dockerfile.XXXXXX) cp "${dockerfile_path}" "$tmp_dockerfile" @@ -132,8 +132,13 @@ function replace_images() { go_builder=$(grep "GO_BUILDER=" "$tmp_dockerfile" | cut -d"=" -f 2) fi + if grep -q "OPM_IMAGE=" "$tmp_dockerfile"; then + opm_image=$(grep "OPM_IMAGE=" "$tmp_dockerfile" | cut -d"=" -f 2) + fi + sed -e "s|\$GO_RUNTIME|${go_runtime:-}|" \ - -e "s|\$GO_BUILDER|${go_builder:-}|" -i "$tmp_dockerfile" + -e "s|\$GO_BUILDER|${go_builder:-}|" \ + -e "s|\$OPM_IMAGE|${opm_image:-}|" -i "$tmp_dockerfile" echo "$tmp_dockerfile" }