reduce the log spam
Some checks are pending
CI / Lint (push) Waiting to run
CI / Test (push) Waiting to run
CI / End-to-End (push) Waiting to run
CI / Publish Docker (push) Blocked by required conditions
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-09-16 13:56:22 +10:00
parent e47718cd7f
commit a84c403a69

View File

@@ -35,11 +35,12 @@ func (h *Handler) VmModify(w http.ResponseWriter, r *http.Request) {
var event models.CloudEventReceived
if err := json.Unmarshal(reqBody, &event); err != nil {
h.Logger.Error("unable to decode json", "error", err)
prettyPrint(reqBody)
http.Error(w, "Invalid JSON body", http.StatusBadRequest)
return
} else {
h.Logger.Debug("successfully decoded JSON")
prettyPrint(event)
//prettyPrint(event)
}
if event.CloudEvent.Data.ConfigChanges == nil {
@@ -50,7 +51,7 @@ func (h *Handler) VmModify(w http.ResponseWriter, r *http.Request) {
} else {
h.Logger.Debug("Received event contains config change info")
configChanges = h.processConfigChanges(event.CloudEvent.Data.ConfigChanges.Modified)
prettyPrint(configChanges)
//prettyPrint(configChanges)
var found = false
// Only interested in vCPU or ram changes currently
@@ -134,6 +135,7 @@ func (h *Handler) VmModify(w http.ResponseWriter, r *http.Request) {
} else {
w.WriteHeader(http.StatusAccepted)
fmt.Fprintf(w, "Processed update event but no config changes were of interest\n")
prettyPrint(configChanges)
}
}
}