solution: config option to disable an upstream
This commit is contained in:
@@ -194,6 +194,9 @@ class UpstreamsConfigReader(
|
||||
upstream.id = getValueAsString(upNode, "id")
|
||||
upstream.options = tryReadOptions(upNode)
|
||||
upstream.methods = tryReadMethods(upNode)
|
||||
getValueAsBool(upNode, "enabled")?.let {
|
||||
upstream.isEnabled = it
|
||||
}
|
||||
}
|
||||
|
||||
internal fun readUpstreamGrpc(
|
||||
|
||||
@@ -63,6 +63,10 @@ open class ConfiguredUpstreams(
|
||||
log.debug("Starting upstreams")
|
||||
val defaultOptions = buildDefaultOptions(config)
|
||||
config.upstreams.forEach { up ->
|
||||
if (!up.isEnabled) {
|
||||
log.debug("Upstream ${up.id} is disabled")
|
||||
return@forEach
|
||||
}
|
||||
log.debug("Start upstream ${up.id}")
|
||||
if (up.connection is UpstreamsConfig.GrpcConnection) {
|
||||
val options = up.options ?: UpstreamsConfig.Options()
|
||||
|
||||
Reference in New Issue
Block a user