Commit f9ea9723 authored by Geoff Simmons's avatar Geoff Simmons

Don't check the dataplane reload state if none has ever been initiated.

parent 3d491ec8
...@@ -200,6 +200,12 @@ func (hc *Controller) updateLoadStatus(inst *haproxyInst) error { ...@@ -200,6 +200,12 @@ func (hc *Controller) updateLoadStatus(inst *haproxyInst) error {
// XXX initiate load // XXX initiate load
} }
if inst.status.dplaneState.ID == "" {
hc.log.Infof("Offloader instance %s: no known TLS config "+
"reload state", inst.name)
return nil
}
hc.log.Debugf("Offloader instance %s: checking reload state: %s", hc.log.Debugf("Offloader instance %s: checking reload state: %s",
inst.name, inst.status.dplaneState.ID) inst.name, inst.status.dplaneState.ID)
reloaded, state, err := inst.dplane.Reloaded(inst.status.dplaneState.ID) reloaded, state, err := inst.dplane.Reloaded(inst.status.dplaneState.ID)
...@@ -311,6 +317,7 @@ func (hc *Controller) updateInstance(inst *haproxyInst, spec *Spec) error { ...@@ -311,6 +317,7 @@ func (hc *Controller) updateInstance(inst *haproxyInst, spec *Spec) error {
return fmt.Errorf("Offloader instance %s: TLS config %s load "+ return fmt.Errorf("Offloader instance %s: TLS config %s load "+
"failed or status unknown: %v", inst.name, spec, state) "failed or status unknown: %v", inst.name, spec, state)
case InProgress: case InProgress:
inst.status.dplaneState = state
hc.log.Debugf("Offloader instance %s: checking reload state: "+ hc.log.Debugf("Offloader instance %s: checking reload state: "+
"%s", inst.name, inst.status.dplaneState.ID) "%s", inst.name, inst.status.dplaneState.ID)
reloaded, state, err := inst.dplane.Reloaded( reloaded, state, err := inst.dplane.Reloaded(
...@@ -431,7 +438,6 @@ func (hc *Controller) removeOffldrInstances( ...@@ -431,7 +438,6 @@ func (hc *Controller) removeOffldrInstances(
switch state.Status { switch state.Status {
case Succeeded: case Succeeded:
inst.status.dplaneState = state
hc.log.Infof("Offloader instance %s: TLS config "+ hc.log.Infof("Offloader instance %s: TLS config "+
"sucessfully deleted at %s", inst.name, "sucessfully deleted at %s", inst.name,
state.Timestamp.Format(time.RFC3339)) state.Timestamp.Format(time.RFC3339))
......
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