Skip to content

Commit b59feea

Browse files
authored
Merge pull request #1231 from stackhpc/fix/delete-bastion-nil-pointer
🐛 Fix nil pointer reference during bastion deletion
2 parents 6e008c8 + 7715d0c commit b59feea

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

controllers/openstackcluster_controller.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,12 +221,12 @@ func deleteBastion(scope *scope.Scope, cluster *clusterv1.Cluster, openStackClus
221221
}
222222
}
223223
}
224-
}
225224

226-
instanceSpec := bastionToInstanceSpec(openStackCluster, cluster.Name)
227-
if err = computeService.DeleteInstance(openStackCluster, instanceSpec, instanceStatus); err != nil {
228-
handleUpdateOSCError(openStackCluster, errors.Errorf("failed to delete bastion: %v", err))
229-
return errors.Errorf("failed to delete bastion: %v", err)
225+
instanceSpec := bastionToInstanceSpec(openStackCluster, cluster.Name)
226+
if err = computeService.DeleteInstance(openStackCluster, instanceSpec, instanceStatus); err != nil {
227+
handleUpdateOSCError(openStackCluster, errors.Errorf("failed to delete bastion: %v", err))
228+
return errors.Errorf("failed to delete bastion: %v", err)
229+
}
230230
}
231231

232232
openStackCluster.Status.Bastion = nil

0 commit comments

Comments
 (0)