From bedc31ea41ec1063f0c4e871c2316ba9b415b9af Mon Sep 17 00:00:00 2001 From: Lukas Piwowarski Date: Fri, 5 Dec 2025 11:46:16 +0100 Subject: [PATCH 1/2] Test KUTTL tests (breaking) --- internal/controller/openstacklightspeed_controller.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/internal/controller/openstacklightspeed_controller.go b/internal/controller/openstacklightspeed_controller.go index 2813f354..89292d02 100644 --- a/internal/controller/openstacklightspeed_controller.go +++ b/internal/controller/openstacklightspeed_controller.go @@ -268,14 +268,6 @@ func (r *OpenStackLightspeedReconciler) reconcileDelete( return ctrl.Result{RequeueAfter: time.Second * 10}, nil } - isUninstalled, err := UninstallInstanceOwnedOLSOperator(ctx, helper, instance) - if err != nil { - return ctrl.Result{}, err - } else if !isUninstalled { - Log.Info("OLS Operator uninstallation in progress ...") - return ctrl.Result{RequeueAfter: time.Second * 10}, nil - } - controllerutil.RemoveFinalizer(instance, helper.GetFinalizer()) Log.Info("OpenStackLightspeed Reconciling Delete completed") From ffb65b72d838d0fc40cbe3f84c94ccf62cbd9b60 Mon Sep 17 00:00:00 2001 From: Lukas Piwowarski Date: Fri, 5 Dec 2025 13:15:20 +0100 Subject: [PATCH 2/2] 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 --- bundle.Dockerfile | 18 +++++++++++++++++- related_images.json | 6 ++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 related_images.json diff --git a/bundle.Dockerfile b/bundle.Dockerfile index 3b92ba18..ed9e4656 100644 --- a/bundle.Dockerfile +++ b/bundle.Dockerfile @@ -1,4 +1,16 @@ -FROM scratch +FROM registry.redhat.io/ubi9/ubi-minimal:9.7 as builder +ARG RELATED_IMAGE_FILE=related_images.json +ARG CSV_FILE=bundle/manifests/openstack-lightspeed-operator.clusterserviceversion.yaml +ARG OPERATOR_IMAGE_ORIGINAL=quay.io/openstack-lightspeed/operator:latest + +RUN microdnf install -y jq + +COPY ${CSV_FILE} /manifests/openstack-lightspeed-operator.clusterserviceversion.yaml +COPY ${RELATED_IMAGE_FILE} /${RELATED_IMAGE_FILE} + +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 + +FROM registry.redhat.io/ubi9/ubi-minimal:9.7 # Core bundle labels. LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1 @@ -6,6 +18,7 @@ LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/ LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/ LABEL operators.operatorframework.io.bundle.package.v1=openstack-lightspeed-operator LABEL operators.operatorframework.io.bundle.channels.v1=alpha +LABEL operators.operatorframework.io.bundle.channel.default.v1=alpha LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.38.0 LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1 LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v4 @@ -18,3 +31,6 @@ LABEL operators.operatorframework.io.test.config.v1=tests/scorecard/ COPY bundle/manifests /manifests/ COPY bundle/metadata /metadata/ COPY bundle/tests/scorecard /tests/scorecard/ + +# Copy the CSV file with replaced image references +COPY --from=builder /manifests/openstack-lightspeed-operator.clusterserviceversion.yaml /manifests/openstack-lightspeed-operator.clusterserviceversion.yaml diff --git a/related_images.json b/related_images.json new file mode 100644 index 00000000..0811e8f7 --- /dev/null +++ b/related_images.json @@ -0,0 +1,6 @@ +[ + { + "name": "openstack-lightspeed-operator", + "image": "quay.io/openstack-lightspeed/operator:latest" + } +]