Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating Sites generates warning messages due to implicitly used named defaults section #106

Open
georgijd-form3 opened this issue Feb 20, 2024 · 0 comments

Comments

@georgijd-form3
Copy link

georgijd-form3 commented Feb 20, 2024

Hi,

I'd like to bring your attention to a minor problem with Site objects.

The SiteService and SiteFarm objects don't have a From field which prevents users from specifying a named defaults section to be used when configuring Sites.

The

func SerializeServiceToFrontend(service *models.SiteService, name string) *models.Frontend {
fr := &models.Frontend{Name: name}
if service != nil {
fr.Mode = service.Mode
fr.Maxconn = service.Maxconn
fr.HTTPConnectionMode = service.HTTPConnectionMode
}
return fr
}

and

func SerializeFarmToBackend(farm *models.SiteFarm) *models.Backend {
return &models.Backend{
Name: farm.Name,
Mode: farm.Mode,
Forwardfor: farm.Forwardfor,
Balance: farm.Balance,
}
}

methods don't set the

From string `json:"from,omitempty"`
and
From string `json:"from,omitempty"`
respectively which leads to warnings in HAProxy when applying the configuration:

[WARNING] (1) : config : parsing [/etc/haproxy/haproxy.cfg:48] : defaults section 'defaults' (declared at /etc/haproxy/haproxy.cfg:22) is explicitly referenced by another proxy and implicitly used here. To avoid any ambiguity don't mix both usage. Add a last defaults section not explicitly used or always use explicit references.

This is not ideal because if we try to update a configuration file with an unnamed defaults section, the config parser automatically renames it as unnamed_defaults_1 and updates all existing sections with from unnamed_defaults_1. When we subsequently update the configuration file via dataplaneapi we get the above warning if we don't set the From attribute for all frontend and backend sections we are trying to create, including the ones created through a Site object

@georgijd-form3 georgijd-form3 changed the title Creating Farms generates warning messages due to implicitly used named defaults section Creating Sites generates warning messages due to implicitly used named defaults section Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant