33usage () {
44 echo " Usage: $0 -s <snapshot-ref> -b <bundle-snapshot-ref> -o <output-file> -p"
55 echo " -s snapshot-ref: required, the snapshot's references, example: ols-cq8sl"
6- echo " -b bundle-snapshot-ref: optional, the ols-bundle snapshot's references, example: ols-bundle-wf8st."
7- echo " if not specified, it will keep the bundle image and revision from the output file"
8- echo " -o output-file: optional, the related images list file to update, default is empty (output to stdout)"
9- echo " -r: optional, use which registry: stable, preview, ci, default is stable"
6+ echo " -b bundle-snapshot-ref: optional, the ols-bundle snapshot's references, example: ols-bundle-wf8st"
7+ echo " -o output-file: optional, the catalog index file to update, default is empty (output to stdout)"
8+ echo " -r: optional, use which registry: stable, preview, ci"
109 echo " -h: Show this help message"
1110 echo " Example: $0 -s ols-cq8sl -b ols-bundle-wf8st -o related_images.json"
1211}
1817
1918SNAPSHOT_REF=" "
2019OUTPUT_FILE=" "
21- DEFAULT_RELATED_IMAGES_FILE=" related_images.json"
22- USE_REGISTRY=" stable"
20+ USE_REGISTRY=" ci"
2321KONFLUX_NAMESPACE=" crt-nshift-lightspeed-tenant"
2422
2523while getopts " :s:b:o:r:h" argname; do
@@ -111,21 +109,13 @@ if [ -n "${BUNDLE_SNAPSHOT_REF}" ]; then
111109 fi
112110fi
113111
114- # Get the bundle image and revision from the bundle snapshot if specified
112+ cp ${TMP_SNAPSHOT_JSON} snapshot.json
113+ cp ${TMP_BUNDLE_SNAPSHOT_JSON} bundle_snapshot.json
114+
115115if [ -n " ${BUNDLE_SNAPSHOT_REF} " ]; then
116116 BUNDLE_IMAGE=$( ${JQ} -r ' .spec.components[]| select(.name=="ols-bundle") | .containerImage' " ${TMP_BUNDLE_SNAPSHOT_JSON} " )
117117 BUNDLE_REVISION=$( ${JQ} -r ' .spec.components[]| select(.name=="ols-bundle") | .source.git.revision' " ${TMP_BUNDLE_SNAPSHOT_JSON} " )
118- else
119- # Keep the bundle image and revision from the output file if the bundle snapshot is not specified
120- if [ -f " ${OUTPUT_FILE} " ]; then
121- BUNDLE_IMAGE=$( ${JQ} -r ' .[]| select(.name=="lightspeed-operator-bundle") | .image' " ${OUTPUT_FILE} " )
122- BUNDLE_REVISION=$( ${JQ} -r ' .[]| select(.name=="lightspeed-operator-bundle") | .revision' " ${OUTPUT_FILE} " )
123- elif [ -f " ${DEFAULT_RELATED_IMAGES_FILE} " ]; then
124- BUNDLE_IMAGE=$( ${JQ} -r ' .[]| select(.name=="lightspeed-operator-bundle") | .image' " ${DEFAULT_RELATED_IMAGES_FILE} " )
125- BUNDLE_REVISION=$( ${JQ} -r ' .[]| select(.name=="lightspeed-operator-bundle") | .revision' " ${DEFAULT_RELATED_IMAGES_FILE} " )
126- fi
127118fi
128-
129119OPERATOR_IMAGE=$( ${JQ} -r ' .spec.components[]| select(.name=="lightspeed-operator") | .containerImage' " ${TMP_SNAPSHOT_JSON} " )
130120OPERATOR_REVISION=$( ${JQ} -r ' .spec.components[]| select(.name=="lightspeed-operator") | .source.git.revision' " ${TMP_SNAPSHOT_JSON} " )
131121CONSOLE_IMAGE=$( ${JQ} -r ' .spec.components[]| select(.name=="lightspeed-console") | .containerImage' " ${TMP_SNAPSHOT_JSON} " )
@@ -136,6 +126,8 @@ SERVICE_IMAGE=$(${JQ} -r '.spec.components[]| select(.name=="lightspeed-service"
136126SERVICE_REVISION=$( ${JQ} -r ' .spec.components[]| select(.name=="lightspeed-service") | .source.git.revision' " ${TMP_SNAPSHOT_JSON} " )
137127OPENSHIFT_MCP_SERVER_IMAGE=$( ${JQ} -r ' .spec.components[]| select(.name=="openshift-mcp-server") | .containerImage' " ${TMP_SNAPSHOT_JSON} " )
138128OPENSHIFT_MCP_SERVER_REVISION=$( ${JQ} -r ' .spec.components[]| select(.name=="openshift-mcp-server") | .source.git.revision' " ${TMP_SNAPSHOT_JSON} " )
129+ DATAVERSE_EXPORTER_IMAGE=$( ${JQ} -r ' .spec.components[]| select(.name=="lightspeed-to-dataverse-exporter") | .containerImage' " ${TMP_SNAPSHOT_JSON} " )
130+ DATAVERSE_EXPORTER_REVISION=$( ${JQ} -r ' .spec.components[]| select(.name=="lightspeed-to-dataverse-exporter") | .source.git.revision' " ${TMP_SNAPSHOT_JSON} " )
139131OCP_RAG_IMAGE=$( ${JQ} -r ' .spec.components[]| select(.name=="lightspeed-ocp-rag") | .containerImage' " ${TMP_SNAPSHOT_JSON} " )
140132OCP_RAG_REVISION=$( ${JQ} -r ' .spec.components[]| select(.name=="lightspeed-ocp-rag") | .source.git.revision' " ${TMP_SNAPSHOT_JSON} " )
141133if [ " ${USE_REGISTRY} " = " preview" ]; then
@@ -144,14 +136,16 @@ if [ "${USE_REGISTRY}" = "preview" ]; then
144136 CONSOLE_IMAGE_BASE_PF5=" registry.redhat.io/openshift-lightspeed-tech-preview/lightspeed-console-plugin-pf5-rhel9"
145137 SERVICE_IMAGE_BASE=" registry.redhat.io/openshift-lightspeed-tech-preview/lightspeed-service-api-rhel9"
146138 OPENSHIFT_MCP_SERVER_IMAGE_BASE=" registry.redhat.io/openshift-lightspeed-tech-preview/openshift-mcp-server-rhel9"
139+ DATAVERSE_EXPORTER_IMAGE_BASE=" registry.redhat.io/openshift-lightspeed-tech-preview/lightspeed-to-dataverse-exporter-rhel9"
147140 OCP_RAG_IMAGE_BASE=" registry.redhat.io/openshift-lightspeed-tech-preview/lightspeed-ocp-rag-rhel9"
148141
149142 OPERATOR_IMAGE=$( sed ' s|quay\.io/redhat-user-workloads/crt-nshift-lightspeed-tenant/ols/lightspeed-operator|' " ${OPERATOR_IMAGE_BASE} " ' |g' <<< ${OPERATOR_IMAGE} )
150143 CONSOLE_IMAGE=$( sed ' s|quay\.io/redhat-user-workloads/crt-nshift-lightspeed-tenant/ols/lightspeed-console|' " ${CONSOLE_IMAGE_BASE} " ' |g' <<< ${CONSOLE_IMAGE} )
151144 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} )
152145 SERVICE_IMAGE=$( sed ' s|quay\.io/redhat-user-workloads/crt-nshift-lightspeed-tenant/ols/lightspeed-service|' " ${SERVICE_IMAGE_BASE} " ' |g' <<< ${SERVICE_IMAGE} )
153146 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} )
154- 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} )
147+ 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} )
148+ 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} )
155149 POSTGRES_IMAGE=$( sed " s|quay\.io.*/lightspeed-postgresql|registry.redhat.io/rhel9/postgresql-16|g" <<< " ${POSTGRES_IMAGE}" )
156150
157151 if [ -n " ${BUNDLE_SNAPSHOT_REF} " ]; then
@@ -166,14 +160,16 @@ if [ "${USE_REGISTRY}" = "stable" ]; then
166160 SERVICE_IMAGE_BASE=" registry.redhat.io/openshift-lightspeed/lightspeed-service-api-rhel9"
167161 CONSOLE_IMAGE_BASE_PF5=" registry.redhat.io/openshift-lightspeed/lightspeed-console-plugin-pf5-rhel9"
168162 OPENSHIFT_MCP_SERVER_IMAGE_BASE=" registry.redhat.io/openshift-lightspeed/openshift-mcp-server-rhel9"
163+ DATAVERSE_EXPORTER_IMAGE_BASE=" registry.redhat.io/openshift-lightspeed/lightspeed-to-dataverse-exporter-rhel9"
169164 OCP_RAG_IMAGE_BASE=" registry.redhat.io/openshift-lightspeed/lightspeed-ocp-rag-rhel9"
170165
171166 OPERATOR_IMAGE=$( sed ' s|quay\.io/redhat-user-workloads/crt-nshift-lightspeed-tenant/ols/lightspeed-operator|' " ${OPERATOR_IMAGE_BASE} " ' |g' <<< ${OPERATOR_IMAGE} )
172167 CONSOLE_IMAGE=$( sed ' s|quay\.io/redhat-user-workloads/crt-nshift-lightspeed-tenant/ols/lightspeed-console|' " ${CONSOLE_IMAGE_BASE} " ' |g' <<< ${CONSOLE_IMAGE} )
173168 SERVICE_IMAGE=$( sed ' s|quay\.io/redhat-user-workloads/crt-nshift-lightspeed-tenant/ols/lightspeed-service|' " ${SERVICE_IMAGE_BASE} " ' |g' <<< ${SERVICE_IMAGE} )
174169 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} )
175170 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} )
176- 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} )
171+ 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} )
172+ 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} )
177173 POSTGRES_IMAGE=$( sed " s|quay\.io.*/lightspeed-postgresql|registry.redhat.io/rhel9/postgresql-16|g" <<< " ${POSTGRES_IMAGE}" )
178174
179175 if [ -n " ${BUNDLE_SNAPSHOT_REF} " ]; then
185181if [ -z " ${POSTGRES_IMAGE} " ] || [ " ${POSTGRES_IMAGE} " == " null" ]; then
186182 if [ -f " ${OUTPUT_FILE} " ]; then
187183 POSTGRES_IMAGE=$( jq -r ' .[] | select(.name == "lightspeed-postgresql") | .image' " ${OUTPUT_FILE} " )
188- elif [ -f " ${DEFAULT_RELATED_IMAGES_FILE} " ]; then
189- POSTGRES_IMAGE=$( jq -r ' .[] | select(.name == "lightspeed-postgresql") | .image' " ${DEFAULT_RELATED_IMAGES_FILE} " )
190184 fi
191185fi
192186
193- if [ -z " ${DATAVERSE_EXPORTER_IMAGE} " ] || [ " ${DATAVERSE_EXPORTER_IMAGE} " == " null" ]; then
194- if [ -f " ${OUTPUT_FILE} " ]; then
195- DATAVERSE_EXPORTER_IMAGE=$( jq -r ' .[] | select(.name == "lightspeed-to-dataverse-exporter") | .image' " ${OUTPUT_FILE} " )
196- elif [ -f " ${DEFAULT_RELATED_IMAGES_FILE} " ]; then
197- DATAVERSE_EXPORTER_IMAGE=$( jq -r ' .[] | select(.name == "lightspeed-to-dataverse-exporter") | .image' " ${DEFAULT_RELATED_IMAGES_FILE} " )
198- fi
187+ if [ -z " ${POSTGRES_IMAGE} " ] || [ " ${POSTGRES_IMAGE} " == " null" ]; then
188+ DEFAULT_POSTGRES_IMAGE=$( grep -o ' PostgresServerImageDefault = "registry[^"]*"' " ${SCRIPT_DIR} /../internal/controller/utils/constants.go" | sed ' s/PostgresServerImageDefault = "\(.*\)"/\1/' )
189+ POSTGRES_IMAGE=" ${DEFAULT_POSTGRES_IMAGE} "
199190fi
200191
201192RELATED_IMAGES=$(
@@ -228,7 +219,8 @@ RELATED_IMAGES=$(
228219 },
229220 {
230221 "name": "lightspeed-to-dataverse-exporter",
231- "image": "${DATAVERSE_EXPORTER_IMAGE} "
222+ "image": "${DATAVERSE_EXPORTER_IMAGE} ",
223+ "revision": "${DATAVERSE_EXPORTER_REVISION} "
232224 },
233225 {
234226 "name": "lightspeed-ocp-rag",
0 commit comments