Skip to content

Commit

Permalink
Add more logs to debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Erkan Erol committed Jul 30, 2024
1 parent 12feea8 commit b73cd9e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Add more logs to improve debugging.

## [0.3.0] - 2024-07-24

### Changed
Expand Down
6 changes: 5 additions & 1 deletion controllers/vspherecluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ func (r *VSphereClusterReconciler) SetupWithManager(mgr ctrl.Manager) error {
}

func (r *VSphereClusterReconciler) reconcileNormal(ctx context.Context, log logr.Logger, vsphereCluster *capv.VSphereCluster) (reconcile.Result, error) {
log.V(1).Info("Reconciling for normal state")
// If the vsphereCluster doesn't have the finalizer, add it.
err := r.addFinalizer(ctx, log, vsphereCluster)
if err != nil {
Expand All @@ -124,8 +125,10 @@ func (r *VSphereClusterReconciler) reconcileNormal(ctx context.Context, log logr
}

func (r *VSphereClusterReconciler) reconcileDelete(ctx context.Context, log logr.Logger, vsphereCluster *capv.VSphereCluster) (reconcile.Result, error) {
log.V(1).Info("Reconciling for deletion")
if !controllerutil.ContainsFinalizer(vsphereCluster, key.CleanerFinalizerName) {
// no-op in case the finalizer is not there (it could have been deleted manually)
// the cleanup is already done
log.V(1).Info("There is no finalizer on VsphereCluster CR. Deletion should have already been done")
return ctrl.Result{}, nil
}

Expand All @@ -139,6 +142,7 @@ func (r *VSphereClusterReconciler) reconcileDelete(ctx context.Context, log logr

sess, err := r.getVCenterSession(ctx, vsphereCluster)
if err != nil {
log.V(1).Error(err, "Error while getting vcenter session")
return reconcile.Result{}, microerror.Mask(err)
}

Expand Down

0 comments on commit b73cd9e

Please sign in to comment.