Commit c30e9e7c authored by Geoff Simmons's avatar Geoff Simmons

Fix tracking whether the haproxy offloader frontend is configured.

parent cd79308d
......@@ -121,6 +121,7 @@ type configStatus struct {
dplaneState ReloadState
version int64
pemExists bool
loaded bool
}
type haproxyInst struct {
......@@ -315,6 +316,7 @@ func (hc *Controller) updateInstance(inst *haproxyInst, spec *Spec) error {
hc.log.Infof("Offloader instance %s: TLS config %s sucessfully"+
"loaded at %s", inst.name, spec,
state.Timestamp.Format(time.RFC3339))
inst.status.loaded = true
return nil
case Failed, Unknown:
return fmt.Errorf("Offloader instance %s: TLS config %s load "+
......@@ -333,6 +335,7 @@ func (hc *Controller) updateInstance(inst *haproxyInst, spec *Spec) error {
hc.log.Infof("Offloader instance %s: TLS config %s "+
"successfully loaded at %s", inst.name, spec,
state.Timestamp.Format(time.RFC3339))
inst.status.loaded = true
return nil
}
// XXX SyncIncomplete
......@@ -377,7 +380,7 @@ func (hc *Controller) updateOffldSvc(svcKey string) error {
}
// XXX metrics
hc.log.Debugf("offloader svc %s: get current status", inst.name)
if err := hc.getOffldStatus(*inst); err != nil {
if err := hc.getOffldStatus(inst); err != nil {
offldrErr := inst.mkError(err)
errs = append(errs, offldrErr)
continue
......@@ -579,7 +582,7 @@ func (hc *Controller) updateOffldrAddrs(key string, addrs []OffldAddr,
return errs
}
func (hc *Controller) getOffldStatus(inst haproxyInst) error {
func (hc *Controller) getOffldStatus(inst *haproxyInst) error {
hc.log.Debugf("Offloader instance %s, checking offloader config",
inst.name)
inst.admMtx.Lock()
......@@ -592,6 +595,7 @@ func (hc *Controller) getOffldStatus(inst haproxyInst) error {
return err
}
inst.status.version = int64(version)
inst.status.loaded = loaded
if loaded {
hc.log.Infof("Offloader instance %s: offloader configured, "+
"version=%d", inst.name, version)
......
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