Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set keep alive false to avoid deadlock #136

Merged
merged 2 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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