Commit 9691f888 authored by Geoff Simmons's avatar Geoff Simmons

Generate a Warn event when a VCL update fails after ConfigMap update.

parent 74fb1ce3
......@@ -44,9 +44,7 @@ import (
"k8s.io/client-go/tools/cache"
)
const (
vclSpecErr = "VCLspecError"
)
const vclSpecErr = "VCLspecError"
// SpecUpdaterConfig represents the user configuration for k8s
// resources that are considered for a VCL update.
......@@ -435,8 +433,8 @@ func (updater *SpecUpdater) Update() error {
return err
}
if err = updater.vc.Update(&spec); err != nil {
// XXX generate Warn event, inc counter
updater.log.Errorf("Update failed: %s", err)
updater.vc.ErrorEvt(varnish.UpdateErr, "VCL update failed: %s",
err)
return err
}
// XXX generate Info event, inc counter(?)
......
......@@ -36,6 +36,8 @@ import (
)
const (
// UpdateErr is the Event reason name when a VCL update fails
UpdateErr = "UpdateFailure"
connectErr = "ConnectFailure"
vsmErr = "SharedMemoryFailure"
pingErr = "PingFailure"
......@@ -47,7 +49,6 @@ const (
panic = "Panic"
vclListErr = "VCLListFailure"
discardErr = "VCLDiscardFailure"
updateErr = "UpdateFailure"
monitorGood = "MonitorGood"
)
......@@ -169,11 +170,11 @@ func (vc *Controller) monitor(monitorIntvl time.Duration) {
}
if vc.updater == nil {
vc.ErrorEvt(updateErr, "Updater not initialized")
vc.ErrorEvt(UpdateErr, "Updater not initialized")
metrics.updateErrs.Inc()
good = false
} else if err := vc.updater.Update(); err != nil {
vc.ErrorEvt(updateErr, "Errors updating Varnish: %+v",
vc.ErrorEvt(UpdateErr, "Errors updating Varnish: %+v",
err)
metrics.updateErrs.Inc()
good = false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment