Commit d407fe0d authored by Geoff Simmons's avatar Geoff Simmons

Fix tracking the reload version of the dataplane API.

parent 7fe34bfb
......@@ -260,8 +260,11 @@ func (hc *Controller) updateInstance(inst *haproxyInst, spec *Spec) error {
hc.log.Infof("Offloader instance %s: PEM file %s exists", inst.name,
spec.CertName())
init := inst.status.version == 0
version := inst.status.version + 1
version := inst.status.version
if version == 0 {
version = 1
}
hc.log.Debugf("Offloader instance %s: %+v", inst.name, inst)
hc.log.Debugf("Offloader instance %s: starting tx for version %d",
inst.name, version)
tx, err := inst.dplane.StartTx(version)
......@@ -271,7 +274,7 @@ func (hc *Controller) updateInstance(inst *haproxyInst, spec *Spec) error {
hc.log.Debugf("Offloader instance %s: started transaction: %+v",
inst.name, tx)
if init {
if tx.Version <= 1 {
hc.log.Debugf("Offloader instance %s: adding TLS config %s",
inst.name, spec)
err = inst.dplane.AddTLS(tx, *spec)
......
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