Commit 255909d5 authored by Geoff Simmons's avatar Geoff Simmons

Fix and simplify the logic to choose add or update haproxy offloader.

While here, make sure that dataplane transactions get deleted,
including after errors.
parent 3edef2e6
......@@ -397,9 +397,10 @@ func (hc *Controller) updateInstance(inst *haproxyInst, spec *Spec) error {
hc.log.Debugf("Offloader instance %s: started transaction: %+v",
inst.name, tx)
if len(spec.Secrets) > 0 && !inst.status.offLoaded {
if tx.Version <= 1 || inst.spec == nil ||
len(inst.spec.Secrets) == 0 {
defer inst.dplane.DeleteTx(tx)
if len(spec.Secrets) > 0 {
if !inst.status.offLoaded {
hc.log.Debugf("Offloader instance %s: "+
"adding TLS config", inst.name)
err = inst.dplane.AddOffldr(tx)
......
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