From 7263ff7e59b3809bf8ea5e7845261a9da14752c7 Mon Sep 17 00:00:00 2001 From: Rob Scott Date: Fri, 5 Apr 2019 16:34:45 -0400 Subject: [PATCH] adding debug info for dashboard responses --- pkg/dashboard/dashboard.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/dashboard/dashboard.go b/pkg/dashboard/dashboard.go index cdd5902e..482b4c60 100644 --- a/pkg/dashboard/dashboard.go +++ b/pkg/dashboard/dashboard.go @@ -3,6 +3,7 @@ package dashboard import ( "bytes" "encoding/json" + "fmt" "html/template" "net/http" @@ -22,13 +23,14 @@ const ( // TemplateData is passed to the dashboard HTML template type TemplateData struct { AuditData validator.AuditData - JSON template.JS + JSON template.JS } // MainHandler gets template data and renders the dashboard with it. func MainHandler(w http.ResponseWriter, r *http.Request, c conf.Configuration, kubeAPI *kube.API) { auditData, err := validator.RunAudit(c, kubeAPI) if err != nil { + fmt.Printf("Error getting audit data %v \n", err) http.Error(w, "Error running audit", 500) return } @@ -39,7 +41,7 @@ func MainHandler(w http.ResponseWriter, r *http.Request, c conf.Configuration, k } templateData := TemplateData{ AuditData: auditData, - JSON: template.JS(jsonData), + JSON: template.JS(jsonData), } tmpl, err := template.New(TemplateName).Funcs(template.FuncMap{ "getWarningWidth": func(rs validator.ResultSummary, fullWidth int) uint {