Skip to content

Commit

Permalink
Do not reconcile if mimir is disabled (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
QuentinBisson authored May 27, 2024
1 parent af400f5 commit c6777b9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
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

- Do nothing if mimir is disabled to avoid deleting prometheus-meta-operator managed resources.

## [0.0.3] - 2024-05-24

### Changed
Expand Down
8 changes: 6 additions & 2 deletions internal/controller/cluster_monitoring_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,13 @@ func (r *ClusterMonitoringReconciler) Reconcile(ctx context.Context, req ctrl.Re
return ctrl.Result{}, errors.WithStack(err)
}

if !r.MonitoringEnabled {
logger.Info("Monitoring is disabled at the installation level")
return ctrl.Result{}, nil
}

// Handle deletion reconciliation loop.
if !cluster.ObjectMeta.DeletionTimestamp.IsZero() || !r.MonitoringEnabled {
if !cluster.ObjectMeta.DeletionTimestamp.IsZero() {
logger.Info("Handling deletion for Cluster", "cluster", cluster.Name)
return r.reconcileDelete(ctx, cluster)
}
Expand Down Expand Up @@ -158,6 +163,5 @@ func (r *ClusterMonitoringReconciler) reconcileDelete(ctx context.Context, clust
}
logger.Info("removed finalizer", "finalizer", monitoring.MonitoringFinalizer)
}
controllerutil.RemoveFinalizer(cluster, monitoring.MonitoringFinalizer)
return ctrl.Result{}, nil
}

0 comments on commit c6777b9

Please sign in to comment.