mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-24 13:42:16 +00:00
14c3c5c121
Relax the condition on "delete server" CLI handler to be able to remove all servers, even non dynamic, except if they are flagged as non purgeable. This change is necessary to extend the use cases for dynamic servers with reload. It's expected that each dynamic server created via the CLI is manually commited in the haproxy configuration by the user. Dynamic servers will be present on reload only if they are present in the configuration file. This means that non-dynamic servers must be allowed to be removable at runtime. The dynamic servers removal reg-test has been updated and renamed to reflect its purpose. A new test is present to check that non-purgeable servers cannot be removed.
12 lines
274 B
Lua
12 lines
274 B
Lua
local function lua_get_srv_stats(txn, name)
|
|
for _, backend in pairs(core.backends) do
|
|
for _, server in pairs(backend.servers) do
|
|
if server.name == name then
|
|
return server:get_stats()
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
core.register_fetches('get_srv_stats', lua_get_srv_stats)
|