Skip to content

Commit

Permalink
Merge pull request #282 from jcmoraisjr/jm-fix-modsec-val
Browse files Browse the repository at this point in the history
Fix validation of mod security conf
  • Loading branch information
jcmoraisjr authored Jan 16, 2019
2 parents 319ad3a + 975ad79 commit 8663a01
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,22 +179,22 @@ func (haproxy *HAProxyController) OnUpdate(cfg ingress.Configuration) error {
reloadRequired := !dynconfig.ConfigBackends(haproxy.currentConfig, updatedConfig)
haproxy.currentConfig = updatedConfig

data, err := haproxy.haproxyTemplate.execute(updatedConfig)
modSecConf, err := haproxy.modsecTemplate.execute(updatedConfig)
if err != nil {
return err
}

configFile, err := haproxy.rewriteConfigFiles(data)
if err != nil {
if err := haproxy.writeModSecConfigFile(modSecConf); err != nil {
return err
}

modSecConf, err := haproxy.modsecTemplate.execute(updatedConfig)
data, err := haproxy.haproxyTemplate.execute(updatedConfig)
if err != nil {
return err
}

if err := haproxy.writeModSecConfigFile(modSecConf); err != nil {
configFile, err := haproxy.rewriteConfigFiles(data)
if err != nil {
return err
}

Expand Down

0 comments on commit 8663a01

Please sign in to comment.