Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .tekton/release/bundle-update/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,7 @@ spec:
-o jsonpath='{.spec.components}')
echo "Snapshot images: $SNAPSHOT_IMAGES"
cd repo
# back up the bundle element
jq '.[] | select(.name == "lightspeed-operator-bundle")' related_images.json > bundle.json
./hack/snapshot_to_image_list.sh -s "${SNAPSHOT_NAME}" -r stable -o related_images.json
# restore the bundle element
jq 'map(select(.name != "lightspeed-operator-bundle"))' related_images.json > tmp.json && mv tmp.json related_images.json
jq -s '.[0] + [.[1]]' related_images.json bundle.json > tmp.json && mv tmp.json related_images.json
PATH=./bin:$PATH make bundle
workingDir: /workspace
env:
Expand Down
48 changes: 28 additions & 20 deletions hack/snapshot_to_image_list.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
usage() {
echo "Usage: $0 -s <snapshot-ref> -b <bundle-snapshot-ref> -o <output-file> -p"
echo " -s snapshot-ref: required, the snapshot's references, example: ols-cq8sl"
echo " -b bundle-snapshot-ref: optional, the ols-bundle snapshot's references, example: ols-bundle-wf8st"
echo " -o output-file: optional, the catalog index file to update, default is empty (output to stdout)"
echo " -r: optional, use which registry: stable, preview, ci"
echo " -b bundle-snapshot-ref: optional, the ols-bundle snapshot's references, example: ols-bundle-wf8st."
echo " if not specified, it will keep the bundle image and revision from the output file"
echo " -o output-file: optional, the related images list file to update, default is empty (output to stdout)"
echo " -r: optional, use which registry: stable, preview, ci, default is stable"
echo " -h: Show this help message"
echo "Example: $0 -s ols-cq8sl -b ols-bundle-wf8st -o related_images.json"
}
Expand All @@ -17,7 +18,8 @@ fi

SNAPSHOT_REF=""
OUTPUT_FILE=""
USE_REGISTRY="ci"
DEFAULT_RELATED_IMAGES_FILE="related_images.json"
USE_REGISTRY="stable"
KONFLUX_NAMESPACE="crt-nshift-lightspeed-tenant"

while getopts ":s:b:o:r:h" argname; do
Expand Down Expand Up @@ -109,13 +111,21 @@ if [ -n "${BUNDLE_SNAPSHOT_REF}" ]; then
fi
fi

cp ${TMP_SNAPSHOT_JSON} snapshot.json
cp ${TMP_BUNDLE_SNAPSHOT_JSON} bundle_snapshot.json

# Get the bundle image and revision from the bundle snapshot if specified
if [ -n "${BUNDLE_SNAPSHOT_REF}" ]; then
BUNDLE_IMAGE=$(${JQ} -r '.spec.components[]| select(.name=="ols-bundle") | .containerImage' "${TMP_BUNDLE_SNAPSHOT_JSON}")
BUNDLE_REVISION=$(${JQ} -r '.spec.components[]| select(.name=="ols-bundle") | .source.git.revision' "${TMP_BUNDLE_SNAPSHOT_JSON}")
else
# Keep the bundle image and revision from the output file if the bundle snapshot is not specified
if [ -f "${OUTPUT_FILE}" ]; then
BUNDLE_IMAGE=$(${JQ} -r '.[]| select(.name=="lightspeed-operator-bundle") | .image' "${OUTPUT_FILE}")
BUNDLE_REVISION=$(${JQ} -r '.[]| select(.name=="lightspeed-operator-bundle") | .revision' "${OUTPUT_FILE}")
elif [ -f "${DEFAULT_RELATED_IMAGES_FILE}" ]; then
BUNDLE_IMAGE=$(${JQ} -r '.[]| select(.name=="lightspeed-operator-bundle") | .image' "${DEFAULT_RELATED_IMAGES_FILE}")
BUNDLE_REVISION=$(${JQ} -r '.[]| select(.name=="lightspeed-operator-bundle") | .revision' "${DEFAULT_RELATED_IMAGES_FILE}")
fi
fi

OPERATOR_IMAGE=$(${JQ} -r '.spec.components[]| select(.name=="lightspeed-operator") | .containerImage' "${TMP_SNAPSHOT_JSON}")
OPERATOR_REVISION=$(${JQ} -r '.spec.components[]| select(.name=="lightspeed-operator") | .source.git.revision' "${TMP_SNAPSHOT_JSON}")
CONSOLE_IMAGE=$(${JQ} -r '.spec.components[]| select(.name=="lightspeed-console") | .containerImage' "${TMP_SNAPSHOT_JSON}")
Expand All @@ -126,8 +136,6 @@ SERVICE_IMAGE=$(${JQ} -r '.spec.components[]| select(.name=="lightspeed-service"
SERVICE_REVISION=$(${JQ} -r '.spec.components[]| select(.name=="lightspeed-service") | .source.git.revision' "${TMP_SNAPSHOT_JSON}")
OPENSHIFT_MCP_SERVER_IMAGE=$(${JQ} -r '.spec.components[]| select(.name=="openshift-mcp-server") | .containerImage' "${TMP_SNAPSHOT_JSON}")
OPENSHIFT_MCP_SERVER_REVISION=$(${JQ} -r '.spec.components[]| select(.name=="openshift-mcp-server") | .source.git.revision' "${TMP_SNAPSHOT_JSON}")
DATAVERSE_EXPORTER_IMAGE=$(${JQ} -r '.spec.components[]| select(.name=="lightspeed-to-dataverse-exporter") | .containerImage' "${TMP_SNAPSHOT_JSON}")
DATAVERSE_EXPORTER_REVISION=$(${JQ} -r '.spec.components[]| select(.name=="lightspeed-to-dataverse-exporter") | .source.git.revision' "${TMP_SNAPSHOT_JSON}")
OCP_RAG_IMAGE=$(${JQ} -r '.spec.components[]| select(.name=="lightspeed-ocp-rag") | .containerImage' "${TMP_SNAPSHOT_JSON}")
OCP_RAG_REVISION=$(${JQ} -r '.spec.components[]| select(.name=="lightspeed-ocp-rag") | .source.git.revision' "${TMP_SNAPSHOT_JSON}")
if [ "${USE_REGISTRY}" = "preview" ]; then
Expand All @@ -136,16 +144,14 @@ if [ "${USE_REGISTRY}" = "preview" ]; then
CONSOLE_IMAGE_BASE_PF5="registry.redhat.io/openshift-lightspeed-tech-preview/lightspeed-console-plugin-pf5-rhel9"
SERVICE_IMAGE_BASE="registry.redhat.io/openshift-lightspeed-tech-preview/lightspeed-service-api-rhel9"
OPENSHIFT_MCP_SERVER_IMAGE_BASE="registry.redhat.io/openshift-lightspeed-tech-preview/openshift-mcp-server-rhel9"
DATAVERSE_EXPORTER_IMAGE_BASE="registry.redhat.io/openshift-lightspeed-tech-preview/lightspeed-to-dataverse-exporter-rhel9"
OCP_RAG_IMAGE_BASE="registry.redhat.io/openshift-lightspeed-tech-preview/lightspeed-ocp-rag-rhel9"

OPERATOR_IMAGE=$(sed 's|quay\.io/redhat-user-workloads/crt-nshift-lightspeed-tenant/ols/lightspeed-operator|'"${OPERATOR_IMAGE_BASE}"'|g' <<<${OPERATOR_IMAGE})
CONSOLE_IMAGE=$(sed 's|quay\.io/redhat-user-workloads/crt-nshift-lightspeed-tenant/ols/lightspeed-console|'"${CONSOLE_IMAGE_BASE}"'|g' <<<${CONSOLE_IMAGE})
CONSOLE_IMAGE_PF5=$(sed 's|quay\.io/redhat-user-workloads/crt-nshift-lightspeed-tenant/lightspeed-console-pf5|'"${CONSOLE_IMAGE_BASE_PF5}"'|g' <<<${CONSOLE_IMAGE_PF5})
SERVICE_IMAGE=$(sed 's|quay\.io/redhat-user-workloads/crt-nshift-lightspeed-tenant/ols/lightspeed-service|'"${SERVICE_IMAGE_BASE}"'|g' <<<${SERVICE_IMAGE})
OPENSHIFT_MCP_SERVER_IMAGE=$(sed 's|quay\.io/redhat-user-workloads/crt-nshift-lightspeed-tenant/openshift-mcp-server|'"${OPENSHIFT_MCP_SERVER_IMAGE_BASE}"'|g' <<<${OPENSHIFT_MCP_SERVER_IMAGE})
DATAVERSE_EXPORTER_IMAGE=$(sed 's|quay\.io/redhat-user-workloads/crt-nshift-lightspeed-tenant/lightspeed-to-dataverse-exporter|'"${DATAVERSE_EXPORTER_IMAGE_BASE}"'|g' <<<${DATAVERSE_EXPORTER_IMAGE})
OCP_RAG_IMAGE=$(sed 's|quay\.io/redhat-user-workloads/crt-nshift-lightspeed-tenant/lightspeed-ocp-rag|'"${OCP_RAG_IMAGE_BASE}"'|g' <<<${OCP_RAG_EXPORTER_IMAGE})
OCP_RAG_IMAGE=$(sed 's|quay\.io/redhat-user-workloads/crt-nshift-lightspeed-tenant/lightspeed-ocp-rag|'"${OCP_RAG_IMAGE_BASE}"'|g' <<<${OCP_RAG_EXPORTER_IMAGE})
POSTGRES_IMAGE=$(sed "s|quay\.io.*/lightspeed-postgresql|registry.redhat.io/rhel9/postgresql-16|g" <<<"${POSTGRES_IMAGE}")

if [ -n "${BUNDLE_SNAPSHOT_REF}" ]; then
Expand All @@ -160,16 +166,14 @@ if [ "${USE_REGISTRY}" = "stable" ]; then
SERVICE_IMAGE_BASE="registry.redhat.io/openshift-lightspeed/lightspeed-service-api-rhel9"
CONSOLE_IMAGE_BASE_PF5="registry.redhat.io/openshift-lightspeed/lightspeed-console-plugin-pf5-rhel9"
OPENSHIFT_MCP_SERVER_IMAGE_BASE="registry.redhat.io/openshift-lightspeed/openshift-mcp-server-rhel9"
DATAVERSE_EXPORTER_IMAGE_BASE="registry.redhat.io/openshift-lightspeed/lightspeed-to-dataverse-exporter-rhel9"
OCP_RAG_IMAGE_BASE="registry.redhat.io/openshift-lightspeed/lightspeed-ocp-rag-rhel9"

OPERATOR_IMAGE=$(sed 's|quay\.io/redhat-user-workloads/crt-nshift-lightspeed-tenant/ols/lightspeed-operator|'"${OPERATOR_IMAGE_BASE}"'|g' <<<${OPERATOR_IMAGE})
CONSOLE_IMAGE=$(sed 's|quay\.io/redhat-user-workloads/crt-nshift-lightspeed-tenant/ols/lightspeed-console|'"${CONSOLE_IMAGE_BASE}"'|g' <<<${CONSOLE_IMAGE})
SERVICE_IMAGE=$(sed 's|quay\.io/redhat-user-workloads/crt-nshift-lightspeed-tenant/ols/lightspeed-service|'"${SERVICE_IMAGE_BASE}"'|g' <<<${SERVICE_IMAGE})
CONSOLE_IMAGE_PF5=$(sed 's|quay\.io/redhat-user-workloads/crt-nshift-lightspeed-tenant/lightspeed-console-pf5|'"${CONSOLE_IMAGE_BASE_PF5}"'|g' <<<${CONSOLE_IMAGE_PF5})
OPENSHIFT_MCP_SERVER_IMAGE=$(sed 's|quay\.io/redhat-user-workloads/crt-nshift-lightspeed-tenant/openshift-mcp-server|'"${OPENSHIFT_MCP_SERVER_IMAGE_BASE}"'|g' <<<${OPENSHIFT_MCP_SERVER_IMAGE})
DATAVERSE_EXPORTER_IMAGE=$(sed 's|quay\.io/redhat-user-workloads/crt-nshift-lightspeed-tenant/lightspeed-to-dataverse-exporter|'"${DATAVERSE_EXPORTER_IMAGE_BASE}"'|g' <<<${DATAVERSE_EXPORTER_IMAGE})
OCP_RAG_IMAGE=$(sed 's|quay\.io/redhat-user-workloads/crt-nshift-lightspeed-tenant/lightspeed-ocp-rag|'"${OCP_RAG_IMAGE_BASE}"'|g' <<<${OCP_RAG_IMAGE})
OCP_RAG_IMAGE=$(sed 's|quay\.io/redhat-user-workloads/crt-nshift-lightspeed-tenant/lightspeed-ocp-rag|'"${OCP_RAG_IMAGE_BASE}"'|g' <<<${OCP_RAG_IMAGE})
POSTGRES_IMAGE=$(sed "s|quay\.io.*/lightspeed-postgresql|registry.redhat.io/rhel9/postgresql-16|g" <<<"${POSTGRES_IMAGE}")

if [ -n "${BUNDLE_SNAPSHOT_REF}" ]; then
Expand All @@ -181,12 +185,17 @@ fi
if [ -z "${POSTGRES_IMAGE}" ] || [ "${POSTGRES_IMAGE}" == "null" ]; then
if [ -f "${OUTPUT_FILE}" ]; then
POSTGRES_IMAGE=$(jq -r '.[] | select(.name == "lightspeed-postgresql") | .image' "${OUTPUT_FILE}")
elif [ -f "${DEFAULT_RELATED_IMAGES_FILE}" ]; then
POSTGRES_IMAGE=$(jq -r '.[] | select(.name == "lightspeed-postgresql") | .image' "${DEFAULT_RELATED_IMAGES_FILE}")
fi
fi

if [ -z "${POSTGRES_IMAGE}" ] || [ "${POSTGRES_IMAGE}" == "null" ]; then
DEFAULT_POSTGRES_IMAGE=$(grep -o 'PostgresServerImageDefault = "registry[^"]*"' "${SCRIPT_DIR}/../internal/controller/utils/constants.go" | sed 's/PostgresServerImageDefault = "\(.*\)"/\1/')
POSTGRES_IMAGE="${DEFAULT_POSTGRES_IMAGE}"
if [ -z "${DATAVERSE_EXPORTER_IMAGE}" ] || [ "${DATAVERSE_EXPORTER_IMAGE}" == "null" ]; then
if [ -f "${OUTPUT_FILE}" ]; then
DATAVERSE_EXPORTER_IMAGE=$(jq -r '.[] | select(.name == "lightspeed-to-dataverse-exporter") | .image' "${OUTPUT_FILE}")
elif [ -f "${DEFAULT_RELATED_IMAGES_FILE}" ]; then
DATAVERSE_EXPORTER_IMAGE=$(jq -r '.[] | select(.name == "lightspeed-to-dataverse-exporter") | .image' "${DEFAULT_RELATED_IMAGES_FILE}")
fi
fi

RELATED_IMAGES=$(
Expand Down Expand Up @@ -219,8 +228,7 @@ RELATED_IMAGES=$(
},
{
"name": "lightspeed-to-dataverse-exporter",
"image": "${DATAVERSE_EXPORTER_IMAGE}",
"revision": "${DATAVERSE_EXPORTER_REVISION}"
"image": "${DATAVERSE_EXPORTER_IMAGE}"
},
{
"name": "lightspeed-ocp-rag",
Expand Down
3 changes: 1 addition & 2 deletions related_images.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
},
{
"name": "lightspeed-to-dataverse-exporter",
"image": "registry.redhat.io/openshift-lightspeed/lightspeed-to-dataverse-exporter-rhel9@sha256:ec8162a742e6c306c35790f45db23be9b9d12f86ea7555be671ae30832efa04f",
"revision": "dd6fd25963907712fcb429a993d43279aa2583fe"
"image": "registry.redhat.io/lightspeed-core/dataverse-exporter-rhel9:0.4.1"
},
{
"name": "lightspeed-ocp-rag",
Expand Down