Skip to content
This repository was archived by the owner on Jul 13, 2026. It is now read-only.

Commit ffb65b7

Browse files
committed
Overwrite images from quay.io in CI
This enables the bundle to use operator images from related_images.json instead of hardcoded quay.io references. This is necessary for Prow CI to test bundles with the operator image built in the same CI run [1]. [1] https://github.com/openshift/lightspeed-operator/blob/main/bundle.Dockerfile
1 parent bedc31e commit ffb65b7

2 files changed

Lines changed: 23 additions & 1 deletion

File tree

bundle.Dockerfile

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
1-
FROM scratch
1+
FROM registry.redhat.io/ubi9/ubi-minimal:9.7 as builder
2+
ARG RELATED_IMAGE_FILE=related_images.json
3+
ARG CSV_FILE=bundle/manifests/openstack-lightspeed-operator.clusterserviceversion.yaml
4+
ARG OPERATOR_IMAGE_ORIGINAL=quay.io/openstack-lightspeed/operator:latest
5+
6+
RUN microdnf install -y jq
7+
8+
COPY ${CSV_FILE} /manifests/openstack-lightspeed-operator.clusterserviceversion.yaml
9+
COPY ${RELATED_IMAGE_FILE} /${RELATED_IMAGE_FILE}
10+
11+
RUN OPERATOR_IMAGE=$(jq -r '.[] | select(.name == "openstack-lightspeed-operator") | .image' /${RELATED_IMAGE_FILE}) && sed -i "s|${OPERATOR_IMAGE_ORIGINAL}|${OPERATOR_IMAGE}|g" /manifests/openstack-lightspeed-operator.clusterserviceversion.yaml
12+
13+
FROM registry.redhat.io/ubi9/ubi-minimal:9.7
214

315
# Core bundle labels.
416
LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
517
LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
618
LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
719
LABEL operators.operatorframework.io.bundle.package.v1=openstack-lightspeed-operator
820
LABEL operators.operatorframework.io.bundle.channels.v1=alpha
21+
LABEL operators.operatorframework.io.bundle.channel.default.v1=alpha
922
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.38.0
1023
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
1124
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v4
@@ -18,3 +31,6 @@ LABEL operators.operatorframework.io.test.config.v1=tests/scorecard/
1831
COPY bundle/manifests /manifests/
1932
COPY bundle/metadata /metadata/
2033
COPY bundle/tests/scorecard /tests/scorecard/
34+
35+
# Copy the CSV file with replaced image references
36+
COPY --from=builder /manifests/openstack-lightspeed-operator.clusterserviceversion.yaml /manifests/openstack-lightspeed-operator.clusterserviceversion.yaml

related_images.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[
2+
{
3+
"name": "openstack-lightspeed-operator",
4+
"image": "quay.io/openstack-lightspeed/operator:latest"
5+
}
6+
]

0 commit comments

Comments
 (0)