Add scale_from_zero flag

Added scale_from_zero to config, docs and wrote unit test for the
value.

Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
This commit is contained in:
Alex Ellis (VMware)
2018-07-17 09:52:01 +01:00
committed by Alex Ellis
parent e67d45caa1
commit a1c2c553a5
3 changed files with 30 additions and 0 deletions

View File

@ -112,6 +112,7 @@ func (ReadConfig) Read(hasEnv HasEnv) GatewayConfig {
secretPath = "/run/secrets/"
}
cfg.SecretMountPath = secretPath
cfg.ScaleFromZero = parseBoolValue(hasEnv.Getenv("scale_from_zero"))
return cfg
}
@ -149,11 +150,16 @@ type GatewayConfig struct {
// If set this will be used to resolve functions directly
DirectFunctionsSuffix string
<<<<<<< HEAD
// If set, reads secrets from file-system for enabling basic auth.
UseBasicAuth bool
// SecretMountPath specifies where to read secrets from for embedded basic auth
SecretMountPath string
=======
// Enable the gateway to scale any service from 0 replicas to its configured "min replicas"
ScaleFromZero bool
>>>>>>> Add scale_from_zero flag
}
// UseNATS Use NATSor not