Skip to content

Commit

Permalink
Merge pull request #1657 from shiftstack/issue1654
Browse files Browse the repository at this point in the history
πŸ› Fix panic on delete before cluster is initialised
  • Loading branch information
k8s-ci-robot authored Sep 8, 2023
2 parents cc25810 + 500cef6 commit 022e20c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions controllers/openstackmachine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -492,9 +492,9 @@ func machineToInstanceSpec(openStackCluster *infrav1.OpenStackCluster, machine *
instanceSpec.SecurityGroups = openStackMachine.Spec.SecurityGroups
if openStackCluster.Spec.ManagedSecurityGroups {
var managedSecurityGroup string
if util.IsControlPlaneMachine(machine) {
if util.IsControlPlaneMachine(machine) && openStackCluster.Status.ControlPlaneSecurityGroup != nil {
managedSecurityGroup = openStackCluster.Status.ControlPlaneSecurityGroup.ID
} else {
} else if openStackCluster.Status.WorkerSecurityGroup != nil {
managedSecurityGroup = openStackCluster.Status.WorkerSecurityGroup.ID
}

Expand Down

0 comments on commit 022e20c

Please sign in to comment.