Skip to content

Commit

Permalink
add few additonal logs
Browse files Browse the repository at this point in the history
Signed-off-by: craig <[email protected]>

rh-pre-commit.version: 2.2.0
rh-pre-commit.check-secrets: ENABLED
  • Loading branch information
maleck13 committed Oct 30, 2024
1 parent 895bf09 commit 39f77c0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions internal/controller/dnshealthcheckprobe_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,16 @@ func (r *DNSProbeReconciler) Reconcile(ctx context.Context, req ctrl.Request) (c
ctx, _ = r.setLoggerValues(ctx, baseLogger, dnsProbe)

if dnsProbe.DeletionTimestamp != nil && !dnsProbe.DeletionTimestamp.IsZero() {
logger.Info("healthcheckprobe deleted cleaning up workers")
r.ProbeManager.StopProbeWorker(ctx, dnsProbe)
controllerutil.RemoveFinalizer(dnsProbe, DNSHealthCheckFinalizer)
if err = r.Update(ctx, dnsProbe); client.IgnoreNotFound(err) != nil {
if apierrors.IsConflict(err) {
return ctrl.Result{Requeue: true}, nil
}
return ctrl.Result{}, err
}
logger.Info("healthcheckprobe deleted cleaning up workers")
r.ProbeManager.StopProbeWorker(ctx, dnsProbe)

return ctrl.Result{}, nil
}

Expand Down
2 changes: 1 addition & 1 deletion internal/probes/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func (w *Probe) performRequest(ctx context.Context, protocol, host, path, ip str
} else if err != nil {
return ProbeResult{CheckedAt: metav1.Now(), Healthy: false, Reason: fmt.Sprintf("error: %s, response: %+v", err.Error(), res)}
}

logger.V(1).Info("health: probe execution complete against ", "url", httpReq.URL, "status code", res.StatusCode)
if !slice.Contains[int](ExpectedResponses, func(i int) bool { return i == res.StatusCode }) {
return ProbeResult{
CheckedAt: metav1.Now(),
Expand Down

0 comments on commit 39f77c0

Please sign in to comment.