Skip to content

Commit

Permalink
Ensure infra and bootstrap objects are owned by Machines
Browse files Browse the repository at this point in the history
Signed-off-by: killianmuldoon <kmuldoon@vmware.com>
  • Loading branch information
killianmuldoon committed Nov 22, 2022
1 parent 844eff2 commit aea4f02
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions internal/controllers/machine/machine_controller_phases.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,8 @@ func (r *Reconciler) reconcileExternal(ctx context.Context, cluster *clusterv1.C
return external.ReconcileOutput{}, err
}

// With the migration from v1alpha2 to v1alpha3, Machine controllers should be the owner for the
// infra Machines, hence remove any existing machineset controller owner reference
if controller := metav1.GetControllerOf(obj); controller != nil && controller.Kind == "MachineSet" {
// Ensure the Machine is the controller owner for infrastructure and bootstrap object it references.
if controller := metav1.GetControllerOf(obj); controller != nil && controller.Kind != "Machine" {
gv, err := schema.ParseGroupVersion(controller.APIVersion)
if err != nil {
return external.ReconcileOutput{}, err
Expand Down

0 comments on commit aea4f02

Please sign in to comment.