Skip to content

Commit 96cb333

Browse files
authored
Added conversion for legacy imageContentSources (openshift#61524)
1 parent b3f2430 commit 96cb333

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

Diff for: ci-operator/step-registry/ipi/conf/vsphere/ipi-conf-vsphere-commands.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,12 @@ if [ ${Z_VERSION} -gt 9 ]; then
268268
fi
269269
if [ -f ${PULL_THROUGH_CACHE_CONFIG} ]; then
270270
echo "$(date -u --rfc-3339=seconds) - pull-through cache configuration found. updating install-config"
271-
cat ${PULL_THROUGH_CACHE_CONFIG} >>${CONFIG}
271+
if [ "${Z_VERSION}" -lt 14 ]; then
272+
echo "$(date -u --rfc-3339=seconds) - detected OCP version < 4.14. converting imageDigestSources to imageContentSources for backwards compatability."
273+
cat ${PULL_THROUGH_CACHE_CONFIG} | sed 's/imageDigestSources/imageContentSources/g' >>${CONFIG}
274+
else
275+
cat ${PULL_THROUGH_CACHE_CONFIG} >>${CONFIG}
276+
fi
272277
else
273278
echo "$(date -u --rfc-3339=seconds) - pull-through cache configuration not found. not updating install-config"
274279
fi

Diff for: ci-operator/step-registry/ipi/conf/vsphere/vcm/ipi-conf-vsphere-vcm-commands.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,12 @@ if [ ${Z_VERSION} -gt 9 ]; then
252252
fi
253253
if [ -f ${PULL_THROUGH_CACHE_CONFIG} ]; then
254254
echo "$(date -u --rfc-3339=seconds) - pull-through cache configuration found. updating install-config"
255-
cat ${PULL_THROUGH_CACHE_CONFIG} >>${CONFIG}
255+
if [ "${Z_VERSION}" -lt 14 ]; then
256+
echo "$(date -u --rfc-3339=seconds) - detected OCP version < 4.14. converting imageDigestSources to imageContentSources for backwards compatability."
257+
cat ${PULL_THROUGH_CACHE_CONFIG} | sed 's/imageDigestSources/imageContentSources/g' >>${CONFIG}
258+
else
259+
cat ${PULL_THROUGH_CACHE_CONFIG} >>${CONFIG}
260+
fi
256261
else
257262
echo "$(date -u --rfc-3339=seconds) - pull-through cache configuration not found. not updating install-config"
258263
fi

Diff for: ci-operator/step-registry/upi/conf/vsphere/vcm/upi-conf-vsphere-vcm-commands.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,12 @@ if [ ${CACHE_FORCE_DISABLE} == "false" ]; then
400400
fi
401401
if [ -f ${PULL_THROUGH_CACHE_CONFIG} ]; then
402402
echo "$(date -u --rfc-3339=seconds) - pull-through cache configuration found. updating install-config"
403-
cat ${PULL_THROUGH_CACHE_CONFIG} >>${install_config}
403+
if [ "${Z_VERSION}" -lt 14 ]; then
404+
echo "$(date -u --rfc-3339=seconds) - detected OCP version < 4.14. converting imageDigestSources to imageContentSources for backwards compatability."
405+
cat ${PULL_THROUGH_CACHE_CONFIG} | sed 's/imageDigestSources/imageContentSources/g' >>${CONFIG}
406+
else
407+
cat ${PULL_THROUGH_CACHE_CONFIG} >>${CONFIG}
408+
fi
404409
else
405410
echo "$(date -u --rfc-3339=seconds) - pull-through cache configuration not found. not updating install-config"
406411
fi

0 commit comments

Comments
 (0)