Skip to content

Commit 7884484

Browse files
authored
Merge pull request #2066 from dlipovetsky/fix-apierrors-bug
🐛 Kubeadm-based Control Plane: Fix error handling during cleanup
2 parents c9924f2 + a7412c7 commit 7884484

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

controlplane/kubeadm/controllers/kubeadm_control_plane_controller.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ func (r *KubeadmControlPlaneReconciler) cleanupFromGeneration(ctx context.Contex
394394
config.SetNamespace(ref.Namespace)
395395
config.SetName(ref.Name)
396396

397-
if err := r.Client.Delete(ctx, config); !apierrors.IsNotFound(err) {
397+
if err := r.Client.Delete(ctx, config); err != nil && !apierrors.IsNotFound(err) {
398398
errs = append(errs, errors.Wrap(err, "failed to cleanup generated resources after error"))
399399
}
400400
}

0 commit comments

Comments
 (0)