Skip to content

Commit

Permalink
BUG/MINOR: prevents unnecessary reloads due to CRD defaults.name
Browse files Browse the repository at this point in the history
Since the default section name is hardcoded as `haproxytech`, every
event processed by the controller will trigger a hard reload,
regardless of the `spec.name` value the user passes in the
Defaults CRD (even if blank), because the comparison check will
never pass (unless the user sets exactly `spec.name = haproxytech`).
  • Loading branch information
fabianonunes committed Mar 9, 2024
1 parent 13fc60b commit a6891c5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/controller/global.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ func (c *HAProxyController) defaultsCfg() {
}
env.SetDefaults(newDefaults)
newDefaults.ErrorFiles = defaults.ErrorFiles
newDefaults.Name = constants.DefaultsSectionName
diff := newDefaults.Diff(*defaults)
if len(diff) != 0 {
if err = c.haproxy.DefaultsPushConfiguration(*newDefaults); err != nil {
Expand Down

0 comments on commit a6891c5

Please sign in to comment.