mirror of
https://github.com/openfaas/faas.git
synced 2025-06-29 18:23:26 +00:00
Allow for customizing the name of the target NATS Streaming cluster.
Signed-off-by: Bruno Miguel Custódio <brunomcustodio@gmail.com>
This commit is contained in:
committed by
Alex Ellis
parent
ff5ec39e4d
commit
365f459b3f
@ -98,6 +98,14 @@ func (ReadConfig) Read(hasEnv HasEnv) (*GatewayConfig, error) {
|
||||
}
|
||||
}
|
||||
|
||||
faasNATSClusterName := hasEnv.Getenv("faas_nats_cluster_name")
|
||||
if len(faasNATSClusterName) > 0 {
|
||||
cfg.NATSClusterName = &faasNATSClusterName
|
||||
} else {
|
||||
v := "faas-cluster"
|
||||
cfg.NATSClusterName = &v
|
||||
}
|
||||
|
||||
prometheusPort := hasEnv.Getenv("faas_prometheus_port")
|
||||
if len(prometheusPort) > 0 {
|
||||
prometheusPortVal, err := strconv.Atoi(prometheusPort)
|
||||
@ -186,6 +194,9 @@ type GatewayConfig struct {
|
||||
// Port of the NATS Service. Required for async mode.
|
||||
NATSPort *int
|
||||
|
||||
// The name of the NATS Streaming cluster. Required for async mode.
|
||||
NATSClusterName *string
|
||||
|
||||
// Host to connect to Prometheus.
|
||||
PrometheusHost string
|
||||
|
||||
|
Reference in New Issue
Block a user