Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com>
  • Loading branch information
coleenquadros committed Sep 17, 2024
1 parent 8863aa5 commit 54b2ff9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/controller/thanosquery_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func (r *ThanosQueryReconciler) syncResources(ctx context.Context, query monitor
"resource", obj.GetName(), "namespace", obj.GetNamespace(),
)
}
if !query.Spec.EnableSelfMonitor {
if query.Spec.EnableSelfMonitor != nil && !*query.Spec.EnableSelfMonitor {
err := manifests.DeleteServiceMonitor(ctx, r.Client, query.Name, query.Namespace)
if err != nil {
r.logger.Error(err, "failed to delete ServiceMonitor")
Expand All @@ -196,7 +196,7 @@ func (r *ThanosQueryReconciler) buildQuerier(ctx context.Context, query monitori
LogLevel: query.Spec.LogLevel,
LogFormat: query.Spec.LogFormat,
ResourceRequirements: query.Spec.ResourceRequirements,
EnableServiceMonitor: query.Spec.EnableSelfMonitor,
EnableServiceMonitor: *query.Spec.EnableSelfMonitor,
}.ApplyDefaults()

endpoints, err := r.getStoreAPIServiceEndpoints(ctx, query)
Expand Down

0 comments on commit 54b2ff9

Please sign in to comment.