Enable configuration of plugins using configmap

This commit is contained in:
Manuel Alejandro de Brito Fontes 2020-04-06 12:02:13 -04:00
parent 9c6873a55d
commit c0db19b0ec
5 changed files with 76 additions and 1 deletions

View file

@ -61,6 +61,7 @@ const (
globalAuthCacheKey = "global-auth-cache-key"
globalAuthCacheDuration = "global-auth-cache-duration"
luaSharedDictsKey = "lua-shared-dicts"
plugins = "plugins"
)
var (
@ -341,6 +342,15 @@ func ReadConfig(src map[string]string) config.Configuration {
delete(conf, workerProcesses)
}
if val, ok := conf[plugins]; ok {
to.Plugins = strings.Split(val, ",")
for i := range to.Plugins {
to.Plugins[i] = strings.TrimSpace(to.Plugins[i])
}
delete(conf, plugins)
}
to.CustomHTTPErrors = filterErrors(errors)
to.SkipAccessLogURLs = skipUrls
to.WhitelistSourceRange = whiteList