Skip to content

Commit a500b0c

Browse files
authored
Merge pull request #1455 from salasberryfin/fix-panic-on-gke-cluster-delete
fix: panic on gke cluster deletion
2 parents 3878a3f + 255366c commit a500b0c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

exp/controllers/gcpmanagedcontrolplane_controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ func (r *GCPManagedControlPlaneReconciler) reconcileDelete(ctx context.Context,
215215
}
216216
}
217217

218-
if conditions.Get(managedControlPlaneScope.GCPManagedControlPlane, infrav1exp.GKEControlPlaneDeletingCondition).Reason == infrav1exp.GKEControlPlaneDeletedReason {
218+
if managedControlPlaneScope.GCPManagedControlPlane != nil &&
219+
conditions.Get(managedControlPlaneScope.GCPManagedControlPlane, infrav1exp.GKEControlPlaneDeletingCondition).Reason == infrav1exp.GKEControlPlaneDeletedReason {
219220
controllerutil.RemoveFinalizer(managedControlPlaneScope.GCPManagedControlPlane, infrav1exp.ManagedControlPlaneFinalizer)
220221
}
221222

0 commit comments

Comments
 (0)