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/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") 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" + } +]