Skip to content
Closed
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
18 changes: 17 additions & 1 deletion bundle.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
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
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
Expand All @@ -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
8 changes: 0 additions & 8 deletions internal/controller/openstacklightspeed_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
6 changes: 6 additions & 0 deletions related_images.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"name": "openstack-lightspeed-operator",
"image": "quay.io/openstack-lightspeed/operator:latest"
}
]
Loading