Skip to content

Commit

Permalink
Removes debug prints
Browse files Browse the repository at this point in the history
  • Loading branch information
thunef committed Oct 30, 2023
1 parent 884d89b commit b0f7746
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions pkg/monitors/grafana/grafana-monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"fmt"
"net/http"
"os"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"strconv"

Expand Down Expand Up @@ -98,12 +97,9 @@ func (service *GrafanaMonitorService) CreateSyntheticCheck(monitor models.Monito
checkId = idResult
}
var tentantId int64
fmt.Fprintln(os.Stderr, "What is config before", monitor.Config)
grafanaConfig, _ := monitor.Config.(*endpointmonitorv1alpha1.GrafanaConfig)
fmt.Fprintln(os.Stderr, "What is config after", grafanaConfig)
if grafanaConfig != nil && &grafanaConfig.TenantId != nil {
tentantId = grafanaConfig.TenantId
fmt.Fprintln(os.Stderr, "Sets tenantId", tentantId)
}
// Creating a new Check object
return &synthetic_monitoring.Check{
Expand All @@ -129,12 +125,10 @@ func (service *GrafanaMonitorService) Add(monitor models.Monitor) {
newCheck, err := service.CreateSyntheticCheck(monitor)
if err != nil {
log.Error(err, "Failed to create synthetic check")
fmt.Fprintln(os.Stderr, "Failed create", err)
return
}

// Using the synthetic monitoring client to add the new check
fmt.Fprintln(os.Stderr, "Result add check", newCheck)
createdCheck, err := service.smClient.AddCheck(service.ctx, *newCheck)
if err != nil {
log.Error(err, "Failed to add new monitor")
Expand All @@ -150,12 +144,10 @@ func (service *GrafanaMonitorService) Update(monitor models.Monitor) {
log.Error(err, "Failed to create synthetic check")
return
}
fmt.Fprintln(os.Stderr, "Result update check", newCheck)
// Using the synthetic monitoring client to update the old check
createdCheck, err := service.smClient.UpdateCheck(service.ctx, *newCheck)
if err != nil {
log.Error(err, "Failed to update monitor")
fmt.Fprintln(os.Stderr, "Failed to update monitor", err)
return
}

Expand Down

0 comments on commit b0f7746

Please sign in to comment.