We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 75e1835 commit 93cc631Copy full SHA for 93cc631
internal/agent/ni/service.go
@@ -18,7 +18,10 @@ import (
18
19
func (a *Agent) createService(tx pgx.Tx) error {
20
log.Infof("Creating service record %s in database", config.Global.Agent.ServiceName)
21
- var servicePorts = []int{config.Global.Agent.ServicePort}
+ var servicePorts []int
22
+ if config.Global.Agent.ServicePort != 0 {
23
+ servicePorts = append(servicePorts, config.Global.Agent.ServicePort)
24
+ }
25
for _, port := range config.Global.Agent.ServicePorts {
26
if i, err := strconv.Atoi(port); err == nil {
27
servicePorts = append(servicePorts, i)
0 commit comments