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" }