Skip to content

Commit

Permalink
remove unnecessary lines
Browse files Browse the repository at this point in the history
  • Loading branch information
dthorsen committed Sep 25, 2020
1 parent 1398f8c commit 1b5e83a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions controllers/machine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,13 +376,10 @@ func (r *MachineReconciler) isDeleteNodeAllowed(ctx context.Context, cluster *cl
return errNilNodeRef
}

var controlPlane *unstructured.Unstructured

// controlPlaneRef is an optional field in the Cluster so skip the external
// managed control plane check if it is nil
if cluster.Spec.ControlPlaneRef != nil {
var err error
controlPlane, err = external.Get(ctx, r.Client, cluster.Spec.ControlPlaneRef, cluster.Spec.ControlPlaneRef.Namespace)
controlPlane, err := external.Get(ctx, r.Client, cluster.Spec.ControlPlaneRef, cluster.Spec.ControlPlaneRef.Namespace)
if err != nil {
return err
}
Expand Down

0 comments on commit 1b5e83a

Please sign in to comment.