Pass service metadata "external-source" for consul UI integration

This commit is contained in:
Preetha Appan
2018-11-16 11:28:56 -06:00
parent 60c6cb8586
commit 3cf22d2903

View File

@@ -566,6 +566,10 @@ func (c *ServiceClient) RegisterAgent(role string, services []*structs.Service)
Tags: service.Tags,
Address: host,
Port: port,
// This enables the consul UI to show that Nomad registered this service
Meta: map[string]string{
"external-source": "nomad",
},
}
ops.regServices = append(ops.regServices, serviceReg)
@@ -660,6 +664,10 @@ func (c *ServiceClient) serviceRegs(ops *operations, service *structs.Service, t
Tags: tags,
Address: ip,
Port: port,
// This enables the consul UI to show that Nomad registered this service
Meta: map[string]string{
"external-source": "nomad",
},
}
ops.regServices = append(ops.regServices, serviceReg)