Skip to content

Commit

Permalink
Fix patch errors not being logged
Browse files Browse the repository at this point in the history
  • Loading branch information
AndiDog committed Aug 17, 2023
1 parent e2f1a48 commit cd72881
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func (r *KubeadmConfigReconciler) SetupWithManager(ctx context.Context, mgr ctrl
func (r *KubeadmConfigReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, rerr error) {
log := ctrl.LoggerFrom(ctx)

// Lookup the kubeadm config
// Look up the kubeadm config
config := &bootstrapv1.KubeadmConfig{}
if err := r.Client.Get(ctx, req.NamespacedName, config); err != nil {
if apierrors.IsNotFound(err) {
Expand Down Expand Up @@ -225,7 +225,7 @@ func (r *KubeadmConfigReconciler) Reconcile(ctx context.Context, req ctrl.Reques
patchOpts = append(patchOpts, patch.WithStatusObservedGeneration{})
}
if err := patchHelper.Patch(ctx, config, patchOpts...); err != nil {
log.Error(rerr, "Failed to patch config")
log.Error(err, "Failed to patch config")
if rerr == nil {
rerr = err
}
Expand Down

0 comments on commit cd72881

Please sign in to comment.