Skip to content

Commit efcbbe9

Browse files
authored
Merge pull request #2291 from Nordix/lentzi90/fix-bastion-deletion-release-0.10
🐛 Fix deletion of cluster when bastion image missing
2 parents 3170ea9 + c62b21f commit efcbbe9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

controllers/openstackcluster_controller.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,11 @@ func (r *OpenStackClusterReconciler) reconcileDelete(ctx context.Context, scope
152152
// A bastion may have been created if cluster initialisation previously reached populating the network status
153153
// We attempt to delete it even if no status was written, just in case
154154
if openStackCluster.Status.Network != nil {
155-
// Attempt to resolve bastion resources before delete. We don't need to worry about starting if the resources have changed on update.
155+
// Attempt to resolve bastion resources before delete.
156+
// Even if we fail, we need to continue with the deletion or risk getting stuck.
157+
// For example, if the image doesn't exist, we do not have a bastion.
156158
if _, err := resolveBastionResources(scope, clusterResourceName, openStackCluster); err != nil {
157-
return reconcile.Result{}, err
159+
scope.Logger().Info("Failed to resolve bastion, continuing.", "error", err)
158160
}
159161

160162
if err := deleteBastion(scope, cluster, openStackCluster); err != nil {

0 commit comments

Comments
 (0)