Skip to content

Commit a3addda

Browse files
cfergeaupraveenkumar
authored andcommitted
snc: Use pre-build patched release images
snc currently rebuilds the patched release image every time it needs one. After recent commits, the patched release image is built by build-patched-kao-kcmo-images.sh and pushed to quay.io/crcont/ocp-release, so snc can reuse this image instead.
1 parent 5d2b5a3 commit a3addda

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

snc-library.sh

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,22 +45,6 @@ function download_oc() {
4545
fi
4646
}
4747

48-
function create_new_release_with_patched_images() {
49-
upstream_registry=quay.io/crcont
50-
openshift_version=$(${OC} adm release info -a ${OPENSHIFT_PULL_SECRET_PATH} ${OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE} -ojsonpath='{.config.config.Labels.io\.openshift\.release}')
51-
# As of now `oc adm release new` not able to parse images which have multiple arch manifest file so we first need to get the digest of the image for specific
52-
# arch and then use that digest with `oc adm release new`.
53-
kao_image_digest=$(${OC} image info -a ${OPENSHIFT_PULL_SECRET_PATH} ${upstream_registry}/openshift-crc-cluster-kube-apiserver-operator:${openshift_version} --filter-by-os=linux/${yq_ARCH} -ojson | jq -r .digest)
54-
kcmo_image_digest=$(${OC} image info -a ${OPENSHIFT_PULL_SECRET_PATH} ${upstream_registry}/openshift-crc-cluster-kube-controller-manager-operator:${openshift_version} --filter-by-os=linux/${yq_ARCH} -ojson | jq -r .digest)
55-
56-
${OC} adm release new -a ${OPENSHIFT_PULL_SECRET_PATH} --from-release=${OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE} \
57-
cluster-kube-apiserver-operator=${upstream_registry}/openshift-crc-cluster-kube-apiserver-operator@${kao_image_digest} \
58-
cluster-kube-controller-manager-operator=${upstream_registry}/openshift-crc-cluster-kube-controller-manager-operator@${kcmo_image_digest} \
59-
--to-image=quay.io/crcont/ocp-release:${openshift_version}
60-
# Replace the release image override with crcont image
61-
OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE=quay.io/crcont/ocp-release:${openshift_version}
62-
}
63-
6448
function run_preflight_checks() {
6549
if [ -z "${OPENSHIFT_PULL_SECRET_PATH-}" ]; then
6650
echo "OpenShift pull secret file path must be specified through the OPENSHIFT_PULL_SECRET_PATH environment variable"

snc.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ fi
7575

7676
if [[ ${USE_PATCHED_RELEASE_IMAGE} == "enabled" ]]
7777
then
78-
echo "Creating a new image with patched KAO/KCMO images"
79-
create_new_release_with_patched_images
78+
echo "Using release image with patched KAO/KCMO images"
79+
OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE=quay.io/crcont/ocp-release:${OPENSHIFT_RELEASE_VERSION}-${yq_ARCH}
8080
echo "OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE set to ${OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE}"
8181
fi
8282

0 commit comments

Comments
 (0)