Skip to content

Consul discovery: parameters are not considered #222

@DXInfinity

Description

@DXInfinity

I'm adding consul discovery using dataplaneapi and found that some parameters are not considered during discovery process.
{
"name": "test-consul",
"address": "127.0.0.1",
"port": 2222,
"enabled": true,
"retry_timeout": 10,
"service_allowlist": [
"test-ext-service"
]
}
service_allowlist is not applied. Discovery process tries to add backends for ALL registered services.
The problem is here:

case <-time.After(c.timeout):
c.logDebug("discovery job reconciliation started")
if err := c.updateServices(); err != nil {
// c.log.Errorf("error while updating service: %w", err)
c.stop()
}

This section misses UpdateParams call:
err := c.discoveryConfig.UpdateParams(discoveryInstanceParams{
Allowlist: c.params.ServiceAllowlist,
Denylist: c.params.ServiceDenylist,
LogFields: c.logFields,
ServerSlotsBase: int(*c.params.ServerSlotsBase),
SlotsGrowthType: *c.params.ServerSlotsGrowthType,
SlotsIncrement: int(c.params.ServerSlotsGrowthIncrement),
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions