fix: Reference to a bundle image digest instead of tag (#1724)
Signed-off-by: Anatolii Bazko <abazko@redhat.com>pull/1725/head
parent
f8de2cae9d
commit
99127ae6f6
|
|
@ -25,7 +25,7 @@ init() {
|
||||||
case $1 in
|
case $1 in
|
||||||
'--channel'|'-c') CHANNEL="$2"; shift 1;;
|
'--channel'|'-c') CHANNEL="$2"; shift 1;;
|
||||||
'--catalog-image'|'-i') CATALOG_IMAGE="$2"; shift 1;;
|
'--catalog-image'|'-i') CATALOG_IMAGE="$2"; shift 1;;
|
||||||
'--bundle-image'|'-n') BUNDLE_IMAGE="$2"; shift 1;;
|
'--bundle-image'|'-b') BUNDLE_IMAGE="$2"; shift 1;;
|
||||||
'--image-tool'|'-t') IMAGE_TOOL="$2"; shift 1;;
|
'--image-tool'|'-t') IMAGE_TOOL="$2"; shift 1;;
|
||||||
'--help'|'-h') usage; exit;;
|
'--help'|'-h') usage; exit;;
|
||||||
esac
|
esac
|
||||||
|
|
@ -33,12 +33,12 @@ init() {
|
||||||
done
|
done
|
||||||
|
|
||||||
[[ ! ${IMAGE_TOOL} ]] && IMAGE_TOOL="docker"
|
[[ ! ${IMAGE_TOOL} ]] && IMAGE_TOOL="docker"
|
||||||
if [[ ! ${CHANNEL} ]] || [[ ! ${CATALOG_IMAGE} ]]; then usage; exit 1; fi
|
if [[ ! ${CHANNEL} ]]; then usage; exit 1; fi
|
||||||
|
|
||||||
BUNDLE_NAME=$(make bundle-name CHANNEL="${CHANNEL}")
|
BUNDLE_NAME=$(make bundle-name CHANNEL="${CHANNEL}")
|
||||||
BUNDLE_VERSION=$(make bundle-version CHANNEL="${CHANNEL}")
|
BUNDLE_VERSION=$(make bundle-version CHANNEL="${CHANNEL}")
|
||||||
REGISTRY="$(echo "${CATALOG_IMAGE}" | rev | cut -d '/' -f2- | rev)"
|
BUNDLE_IMAGE="${BUNDLE_IMAGE:=quay.io/eclipse/eclipse-che-olm-bundle:${BUNDLE_VERSION}}"
|
||||||
BUNDLE_IMAGE="${BUNDLE_IMAGE:=${REGISTRY}/eclipse-che-olm-bundle:${BUNDLE_VERSION}}"
|
CATALOG_IMAGE=${CATALOG_IMAGE:=quay.io/eclipse/eclipse-che-olm-catalog:${CHANNEL}}
|
||||||
|
|
||||||
echo "[INFO] Bundle name : ${BUNDLE_NAME}"
|
echo "[INFO] Bundle name : ${BUNDLE_NAME}"
|
||||||
echo "[INFO] Bundle version: ${BUNDLE_VERSION}"
|
echo "[INFO] Bundle version: ${BUNDLE_VERSION}"
|
||||||
|
|
@ -54,12 +54,13 @@ usage () {
|
||||||
echo
|
echo
|
||||||
echo "Options:"
|
echo "Options:"
|
||||||
echo -e "\t-i,--catalog-image Catalog image to build"
|
echo -e "\t-i,--catalog-image Catalog image to build"
|
||||||
|
echo -e "\t-i,--bundle-image Bundle image to build"
|
||||||
echo -e "\t-c,--channel=next|stable Olm channel to build bundle from"
|
echo -e "\t-c,--channel=next|stable Olm channel to build bundle from"
|
||||||
echo -e "\t-t,--image-tool [default: docker] Image tool"
|
echo -e "\t-t,--image-tool [default: docker] Image tool"
|
||||||
echo
|
echo
|
||||||
echo "Example:"
|
echo "Example:"
|
||||||
echo -e "\t$0 -i quay.io/eclipse/eclipse-che-olm-catalog:next -c next"
|
echo -e "\t$0 -c next"
|
||||||
echo -e "\t$0 -i quay.io/eclipse/eclipse-che-olm-catalog:stable -c stable"
|
echo -e "\t$0 -c stable"
|
||||||
}
|
}
|
||||||
|
|
||||||
build () {
|
build () {
|
||||||
|
|
@ -73,8 +74,17 @@ build () {
|
||||||
make bundle-build bundle-push CHANNEL="${CHANNEL}" BUNDLE_IMG="${BUNDLE_IMAGE}" IMAGE_TOOL="${IMAGE_TOOL}"
|
make bundle-build bundle-push CHANNEL="${CHANNEL}" BUNDLE_IMG="${BUNDLE_IMAGE}" IMAGE_TOOL="${IMAGE_TOOL}"
|
||||||
|
|
||||||
echo "[INFO] Add bundle to the catalog"
|
echo "[INFO] Add bundle to the catalog"
|
||||||
|
|
||||||
|
BUNDLE_IMAGE_INSPECT=$(skopeo inspect docker://${BUNDLE_IMAGE})
|
||||||
|
BUNDLE_IMAGE_WITH_DIGESTS=$(echo "${BUNDLE_IMAGE_INSPECT}" | jq -r '.Name')@$(echo "${BUNDLE_IMAGE_INSPECT}" | jq -r '.Digest')
|
||||||
|
|
||||||
|
echo "[INFO] Build image with digest: ${BUNDLE_IMAGE_WITH_DIGESTS}"
|
||||||
|
|
||||||
|
# Reference to the bundle image with digest instead of tag
|
||||||
|
# to deploy Eclipse Che in disconnected cluster
|
||||||
|
make bundle-render CHANNEL="${CHANNEL}" BUNDLE_NAME="${BUNDLE_NAME}" BUNDLE_IMG="${BUNDLE_IMAGE_WITH_DIGESTS}"
|
||||||
|
|
||||||
LAST_BUNDLE_NAME=$(yq -r '.entries | .[length - 1].name' "${CHANNEL_PATH}")
|
LAST_BUNDLE_NAME=$(yq -r '.entries | .[length - 1].name' "${CHANNEL_PATH}")
|
||||||
make bundle-render CHANNEL="${CHANNEL}" BUNDLE_NAME="${BUNDLE_NAME}" BUNDLE_IMG="${BUNDLE_IMAGE}"
|
|
||||||
if [[ ${CHANNEL} == "stable" ]]; then
|
if [[ ${CHANNEL} == "stable" ]]; then
|
||||||
yq -riY '(.entries) += [{"name": "'${BUNDLE_NAME}'", "replaces": "'${LAST_BUNDLE_NAME}'"}]' "${CHANNEL_PATH}"
|
yq -riY '(.entries) += [{"name": "'${BUNDLE_NAME}'", "replaces": "'${LAST_BUNDLE_NAME}'"}]' "${CHANNEL_PATH}"
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ metadata:
|
||||||
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
|
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
|
||||||
repository: https://github.com/eclipse-che/che-operator
|
repository: https://github.com/eclipse-che/che-operator
|
||||||
support: Eclipse Foundation
|
support: Eclipse Foundation
|
||||||
name: eclipse-che.v7.71.0-799.next
|
name: eclipse-che.v7.71.0-801.next
|
||||||
namespace: placeholder
|
namespace: placeholder
|
||||||
spec:
|
spec:
|
||||||
apiservicedefinitions: {}
|
apiservicedefinitions: {}
|
||||||
|
|
@ -1231,7 +1231,7 @@ spec:
|
||||||
minKubeVersion: 1.19.0
|
minKubeVersion: 1.19.0
|
||||||
provider:
|
provider:
|
||||||
name: Eclipse Foundation
|
name: Eclipse Foundation
|
||||||
version: 7.71.0-799.next
|
version: 7.71.0-801.next
|
||||||
webhookdefinitions:
|
webhookdefinitions:
|
||||||
- admissionReviewVersions:
|
- admissionReviewVersions:
|
||||||
- v1
|
- v1
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue