diff --git a/src/cfgparse-global.c b/src/cfgparse-global.c index 825bc4c93..87adf1b89 100644 --- a/src/cfgparse-global.c +++ b/src/cfgparse-global.c @@ -977,6 +977,9 @@ static int cfg_parse_global_master_worker(char **args, int section_type, struct proxy *curpx, const struct proxy *defpx, const char *file, int line, char **err) { + if (!(global.mode & MODE_DISCOVERY)) + return 0; + if (too_many_args(1, args, err, NULL)) return -1; @@ -999,6 +1002,9 @@ static int cfg_parse_global_mode(char **args, int section_type, struct proxy *curpx, const struct proxy *defpx, const char *file, int line, char **err) { + if (!(global.mode & MODE_DISCOVERY)) + return 0; + if (too_many_args(0, args, err, NULL)) return -1; @@ -1024,6 +1030,9 @@ static int cfg_parse_global_disable_poller(char **args, int section_type, struct proxy *curpx, const struct proxy *defpx, const char *file, int line, char **err) { + if (!(global.mode & MODE_DISCOVERY)) + return 0; + if (too_many_args(0, args, err, NULL)) return -1; @@ -1051,6 +1060,9 @@ static int cfg_parse_global_pidfile(char **args, int section_type, struct proxy *curpx, const struct proxy *defpx, const char *file, int line, char **err) { + if (!(global.mode & MODE_DISCOVERY)) + return 0; + if (too_many_args(1, args, err, NULL)) return -1; diff --git a/src/mworker.c b/src/mworker.c index 90caed279..c47625c76 100644 --- a/src/mworker.c +++ b/src/mworker.c @@ -751,6 +751,8 @@ static int mworker_parse_global_max_reloads(char **args, int section_type, struc { int err_code = 0; + if (!(global.mode & MODE_DISCOVERY)) + return 0; if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out;