Skip to content

Commit cea7753

Browse files
committed
ING-1344: Allow users to configure the server group name
1 parent da31781 commit cea7753

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

cmd/gateway/main.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ func init() {
104104
configFlags.String("otel-exporter-headers", "", "a comma seperated list of otlp expoter headers, e.g 'header1=value1,header2=value2'")
105105
configFlags.String("dapi-proxy-services", "", "specifies services exposed via _p endpoint proxies")
106106
configFlags.Bool("dapi-no-proxy-admin", false, "disables admin endpoints through proxies")
107+
configFlags.String("server-group", "", "specifies the server group name")
107108
configFlags.Bool("alpha-endpoints", false, "enables alpha endpoints")
108109
configFlags.Bool("debug", false, "enable debug mode")
109110
configFlags.Bool("pprof", false, "enable pprof endpoints")
@@ -280,6 +281,7 @@ type config struct {
280281
otelExporterHeaders string
281282
dapiProxyServices string
282283
dapiNoProxyAdmin bool
284+
serverGroup string
283285
alphaEndpoints bool
284286
debug bool
285287
pprof bool
@@ -324,6 +326,7 @@ func readConfig(logger *zap.Logger) *config {
324326
otelExporterHeaders: viper.GetString("otel-exporter-headers"),
325327
dapiProxyServices: viper.GetString("dapi-proxy-services"),
326328
dapiNoProxyAdmin: viper.GetBool("dapi-no-proxy-admin"),
329+
serverGroup: viper.GetString("server-group"),
327330
alphaEndpoints: viper.GetBool("alpha-endpoints"),
328331
debug: viper.GetBool("debug"),
329332
pprof: viper.GetBool("pprof"),
@@ -367,6 +370,7 @@ func readConfig(logger *zap.Logger) *config {
367370
// zap.String("honeycombKey", config.honeycombKey),
368371
zap.String("dapiProxyServices", config.dapiProxyServices),
369372
zap.Bool("dapiNoProxyAdmin", config.dapiNoProxyAdmin),
373+
zap.String("serverGroup", config.serverGroup),
370374
zap.Bool("alphaEndpoints", config.alphaEndpoints),
371375
zap.Bool("debug", config.debug),
372376
zap.Bool("pprof", config.pprof),
@@ -644,6 +648,7 @@ func startGateway() {
644648
Debug: config.debug,
645649
ProxyServices: strings.Split(config.dapiProxyServices, ","),
646650
ProxyBlockAdmin: config.dapiNoProxyAdmin,
651+
ServerGroup: config.serverGroup,
647652
AlphaEndpoints: config.alphaEndpoints,
648653
BindDataPort: config.dataPort,
649654
BindDapiPort: config.dapiPort,
@@ -738,6 +743,9 @@ func startGateway() {
738743
if newConfig.alphaEndpoints != config.alphaEndpoints {
739744
logger.Warn("config changes for alphaEndpoints require a restart")
740745
}
746+
if newConfig.serverGroup != config.serverGroup {
747+
logger.Warn("config changes for serverGroup require a restart")
748+
}
741749

742750
if newConfig.logLevelStr != config.logLevelStr {
743751
newParsedLogLevel, err := zapcore.ParseLevel(newConfig.logLevelStr)

0 commit comments

Comments
 (0)