Skip to content

Commit

Permalink
Merge pull request #5575 from sbueringer/pr-improve-md-log
Browse files Browse the repository at this point in the history
🌱 MachineDeploymentReconciler: log successful MachineSet adoption
  • Loading branch information
k8s-ci-robot authored Nov 3, 2021
2 parents 3c5894c + bb112fd commit 33b0f87
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion controllers/machinedeployment_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,11 @@ func (r *MachineDeploymentReconciler) getMachineSetsForDeployment(ctx context.Co
// Attempt to adopt machine if it meets previous conditions and it has no controller references.
if metav1.GetControllerOf(ms) == nil {
if err := r.adoptOrphan(ctx, d, ms); err != nil {
r.recorder.Eventf(d, corev1.EventTypeWarning, "FailedAdopt", "Failed to adopt MachineSet %q: %v", ms.Name, err)
log.Error(err, "Failed to adopt MachineSet into MachineDeployment", "machineset", ms.Name)
r.recorder.Eventf(d, corev1.EventTypeWarning, "FailedAdopt", "Failed to adopt MachineSet %q: %v", ms.Name, err)
continue
}
log.Info("Adopted MachineSet into MachineDeployment", "machineset", ms.Name)
r.recorder.Eventf(d, corev1.EventTypeNormal, "SuccessfulAdopt", "Adopted MachineSet %q", ms.Name)
}

Expand Down

0 comments on commit 33b0f87

Please sign in to comment.