Skip to content

Commit

Permalink
fix: Skip HelmChartProxy reconciliation for paused clusters
Browse files Browse the repository at this point in the history
This fixes a bug leading to duplicate `HelmReleaseProxy` resources
following a `clusterctl move` that can happen due to a race between
reconciling the `HelmChartProxy` and moving and unpausing the `Cluster`.
  • Loading branch information
jimmidyson committed Mar 13, 2024
1 parent f5b0864 commit 17bca6e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions controllers/helmchartproxy/helmchartproxy_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,12 @@ func (r *HelmChartProxyReconciler) reconcileNormal(ctx context.Context, helmChar
continue
}

// Don't reconcile if the Cluster is paused.
if cluster.Spec.Paused {
log.V(2).Info("Cluster is paused, skipping reconcile", "cluster", cluster.Name)
continue
}

err := r.reconcileForCluster(ctx, helmChartProxy, cluster)
if err != nil {
return err
Expand Down

0 comments on commit 17bca6e

Please sign in to comment.