From 3cf22d2903c0338d30f05908f7e23d06dbccc4c0 Mon Sep 17 00:00:00 2001 From: Preetha Appan Date: Fri, 16 Nov 2018 11:28:56 -0600 Subject: [PATCH] Pass service metadata "external-source" for consul UI integration --- command/agent/consul/client.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/command/agent/consul/client.go b/command/agent/consul/client.go index 30e3f9f6798..b5cd3d68621 100644 --- a/command/agent/consul/client.go +++ b/command/agent/consul/client.go @@ -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)