mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-06 23:27:04 +02:00
MINOR: cfgparse: Add a global option to expose deprecated directives
Similarly to "expose-exprimental-directives" option, there is no a global option to expose some deprecated directives. Idea is to have a way to silent warnings about deprecated directives when there is no alternative solution. Of course, deprecated directives covered by this option are not listed and may change. It is only a best effort to let users upgrade smoothly.
This commit is contained in:
parent
dff9807188
commit
189f74d4ff
@ -1262,6 +1262,7 @@ The following keywords are supported in the "global" section :
|
|||||||
- deviceatlas-log-level
|
- deviceatlas-log-level
|
||||||
- deviceatlas-properties-cookie
|
- deviceatlas-properties-cookie
|
||||||
- deviceatlas-separator
|
- deviceatlas-separator
|
||||||
|
- expose-deprecated-directives
|
||||||
- expose-experimental-directives
|
- expose-experimental-directives
|
||||||
- external-check
|
- external-check
|
||||||
- fd-hard-limit
|
- fd-hard-limit
|
||||||
@ -1738,6 +1739,12 @@ deviceatlas-separator <char>
|
|||||||
Sets the character separator for the API properties results. This directive
|
Sets the character separator for the API properties results. This directive
|
||||||
is optional and set to | by default if not set.
|
is optional and set to | by default if not set.
|
||||||
|
|
||||||
|
expose-deprecated-directives
|
||||||
|
This statement must appear before using some directives tagged as deprecated
|
||||||
|
to silent warnings and make sure the config file will not be rejected. Not
|
||||||
|
all deprecated directives are concerned, only those without any alternative
|
||||||
|
solution.
|
||||||
|
|
||||||
expose-experimental-directives
|
expose-experimental-directives
|
||||||
This statement must appear before using directives tagged as experimental or
|
This statement must appear before using directives tagged as experimental or
|
||||||
the config file will be rejected.
|
the config file will be rejected.
|
||||||
|
@ -78,6 +78,7 @@ static inline int already_warned(unsigned int warning)
|
|||||||
}
|
}
|
||||||
|
|
||||||
extern unsigned int experimental_directives_allowed;
|
extern unsigned int experimental_directives_allowed;
|
||||||
|
extern unsigned int deprecated_directives_allowed;
|
||||||
|
|
||||||
struct cfg_keyword;
|
struct cfg_keyword;
|
||||||
int check_kw_experimental(struct cfg_keyword *kw, const char *file, int linenum,
|
int check_kw_experimental(struct cfg_keyword *kw, const char *file, int linenum,
|
||||||
|
@ -75,6 +75,9 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm)
|
|||||||
alertif_too_many_args(0, file, linenum, args, &err_code);
|
alertif_too_many_args(0, file, linenum, args, &err_code);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
else if (strcmp(args[0], "expose-deprecated-directives") == 0) {
|
||||||
|
deprecated_directives_allowed = 1;
|
||||||
|
}
|
||||||
else if (strcmp(args[0], "expose-experimental-directives") == 0) {
|
else if (strcmp(args[0], "expose-experimental-directives") == 0) {
|
||||||
experimental_directives_allowed = 1;
|
experimental_directives_allowed = 1;
|
||||||
}
|
}
|
||||||
|
@ -267,6 +267,7 @@ unsigned int warned = 0;
|
|||||||
unsigned int tainted = 0;
|
unsigned int tainted = 0;
|
||||||
|
|
||||||
unsigned int experimental_directives_allowed = 0;
|
unsigned int experimental_directives_allowed = 0;
|
||||||
|
unsigned int deprecated_directives_allowed = 0;
|
||||||
|
|
||||||
int check_kw_experimental(struct cfg_keyword *kw, const char *file, int linenum,
|
int check_kw_experimental(struct cfg_keyword *kw, const char *file, int linenum,
|
||||||
char **errmsg)
|
char **errmsg)
|
||||||
|
Loading…
Reference in New Issue
Block a user