mirror of
https://github.com/haproxy/haproxy.git
synced 2026-03-02 21:30:25 -05:00
MINOR: proxy: prevent backend removal when unsupported
Prevent removal of a backend which relies on features not compatible with dynamic backends. This is the case if either dispatch or transparent option is used, or if a stick-table is declared. These limitations are similar to the "add backend" ones.
This commit is contained in:
parent
ad1e00b2ac
commit
7bf3020952
2 changed files with 15 additions and 0 deletions
|
|
@ -2130,6 +2130,11 @@ del backend <name>
|
|||
This operation is only possible for TCP or HTTP proxies. To succeed, the
|
||||
backend instance must have been first unpublished.
|
||||
|
||||
There is also additional restrictions which prevent backend removal.
|
||||
Currently, this is the case when deprecated dispatch or option transparent
|
||||
are used. Also, a backend cannot be removed if there is a stick-table
|
||||
declared in it.
|
||||
|
||||
This command is restricted and can only be issued on sockets configured for
|
||||
level "admin". Moreover, this feature is still considered in development so it
|
||||
also requires experimental mode (see "experimental-mode on").
|
||||
|
|
|
|||
10
src/proxy.c
10
src/proxy.c
|
|
@ -5014,6 +5014,16 @@ int be_check_for_deletion(const char *bename, struct proxy **pb, const char **pm
|
|||
goto out;
|
||||
}
|
||||
|
||||
if (be->options & (PR_O_DISPATCH|PR_O_TRANSP)) {
|
||||
msg = "Deletion of backend with deprecated dispatch/transparent options is not supported.";
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (be->table) {
|
||||
msg = "Cannot remove a backend with stick-table.";
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (be->cap & PR_CAP_FE) {
|
||||
msg = "Cannot delete a listen section.";
|
||||
goto out;
|
||||
|
|
|
|||
Loading…
Reference in a new issue