Skip to content

Commit 2aff798

Browse files
authored
Merge pull request #130 from ggiguash/kube-proxy-fix
Use main branch as a fallback for kube-proxy builds
2 parents 89d9917 + 4260fee commit 2aff798

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/okd/build_images.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,13 @@ kube_proxy_image() {
106106
local -r dockerfile_path="images/kube-proxy/Dockerfile.rhel"
107107
local -r repo="${WORKDIR}/$(basename "${repo_url}")"
108108

109-
git_clone_repo "${repo_url}" "${OCP_BRANCH}" "${repo}"
109+
# Use the main branch of the sdn repository as a fallback because
110+
# it may not have all the OpenShift release tags
111+
if ! git_clone_repo "${repo_url}" "${OCP_BRANCH}" "${repo}" ; then
112+
echo "WARNING: Failed to clone the sdn repository for the branch '${OCP_BRANCH}'. Using the main branch as a fallback."
113+
git_clone_repo "${repo_url}" main "${repo}"
114+
fi
115+
110116
# This is a special case because the 4.17 image is not available in the registry
111117
# for the ARM64 platform, so we use the 4.19 image instead.
112118
sed -i 's|^FROM registry.ci.openshift.org/ocp/builder.*|FROM registry.ci.openshift.org/openshift/release:rhel-9-release-golang-1.22-openshift-4.19 AS builder|' "${dockerfile_path}"

0 commit comments

Comments
 (0)